jQuery datatable column width on edit mode -
i using jquery datatable inline editing functionalities. able define custom widths table, however, enter edit mode, column width expands , table keeps jumping , forth. seems view 'swidth' works fine, , desired column width, user presses double click enter edit mode, column size expands , squeezes other columns. lingering issue within actual js code or doing wrong?
here script:
$(document).ready(function(){ otable = $("#datatables").datatable({ "aocolumns" : [ { "sname" : "fullname", "swidth" : "15%" }, { "sname" : "location", "sclass": "aligncenter" }, { "sname" : "lengthofstay", "sclass": "aligncenter" }, { "sname" : "codestatus", "sclass": "aligncenter" }, { "sname" : "dvt", "sclass": "aligncenter" }, { "sname" : "catheter", "sclass": "aligncenter" }, { "sname" : "lae", "sclass": "aligncenter" }, { "sname" : "lace", "sclass": "aligncenter" }, { "sname" : "comments", "swidth" : "25%" }, { "sname" : "discharge", "sclass": "aligncenter" } ], "aasorting":[[1, "desc"]], "bpaginate": false, "blengthchange": false, "bfilter": false, "bsort": true, "binfo": false, "bautowidth": false, "sajaxsource" : 'checklistdataallteam', "sservermethod": "get", "fndrawcallback" : function(osettings) { //the call makeeditable set here make sure data loaded this.makeeditable({ oeditablesettings: { event: 'dblclick' }, supdateurl : 'updatechecklistdata', aocolumns : [ null, //patient name; no editing null, //location; no editing null, //stay length; no editing { //code status; default edit placeholder: '-' }, { //dvt; default edit placeholder: '-', }, { //catheter, default edit placeholder: '-', }, null, //lae; no editing null, //lace; no editing { //comment; default editing placeholder: '-', }, null //discharge; no editing ] }); } }); });
i using jeditable version 1.7.1, datatables version 1.9.4 , jquery.datatables.editable.js version 1.1.5
i believe problem may solved setting width attribute 100% when jeditable function datatable initialized. see here: datatable column resizes on edit
that link refers editable demo, , when view code on page, can see how width attribute used.
Comments
Post a Comment