mirror of https://github.com/abpframework/abp
				
				
				
			Reduced repeating same fields #283
	
		
	
				
					
				
			From now on, no need to set targets field of columnDefs and some fields of rowAction column (targets,data,orderable,autoWidth,defaultContent)...
Example usage:
var _dataTable = _$table.DataTable(abp.libs.datatables.normalizeConfiguration({
            order: [[1, "asc"]],
            ajax: abp.libs.datatables.createAjax(_identityUserAppService.getList),
            columnDefs: [
                {
                    rowAction: {
                        element: $("<button/>")
                            .addClass("btn btn-primary btn-sm m-btn--icon")
                            .text("My button")
                            .prepend($("<i/>").addClass("la la-sign-in"))
                            .click(function () {
                                console.log($(this).data());
                            })
                    },
                    rowAction1: {
                        items:
                            [
                                {
                                    text: "ITEM#1",
                                    action: function (data) {
                                        _editModal.open({
                                            id: data.record.id
                                        });
                                    }
                                },
                                {
                                    text: "ITEM#2",
                                    action: function (data) {
                                        _editModal.open({
                                            id: data.record.id
                                        });
                                    }
                                },
                                {
                                    text: "ITEM#3",
                                    visible: function (data) {
                                        return true;
                                    },
                                    action: function (data) {
                                        _editModal.open({
                                            id: data.record.id
                                        });
                                    }
                                },
                                {
                                    text: "ITEM#4",
                                    visible: function (data) {
                                        return true;
                                    },
                                    action: function (data) {
                                        _editModal.open({
                                            id: data.record.id
                                        });
                                    }
                                }
                            ]
                    }
                },
                {
                    data: "userName"
                },
                {
                    data: "email"
                },
                {
                    data: "phoneNumber"
                }
            ]
        }));
			
			
				pull/335/head
			
			
		
							parent
							
								
									7ff1d809c8
								
							
						
					
					
						commit
						98d53dfebf
					
				
					Loading…
					
					
				
		Reference in new issue
	
	 Alper Ebicoglu
						Alper Ebicoglu