jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Buttons in the last row disappear after I add a few rows in grid
Tagged: Button, datagrid, grid, javascript datagrid, jqxgrid
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 12 years, 9 months ago.
-
Author
-
Hi,
After I add several rows in the grid, the columns in the bottom row whose column type is set to ‘button’ become empty but other columns display normally.
And another strange thing,related to what I mentioned above, is that when the columns are resized, the buttons disappear and then when I resize back, the buttons show back again. For your information this does not happen all the time – erratic.
Can you help me with above issues?
Best Regards,
midiHi midi,
Could you send a sample code which reproduces that issue? Is the Grid’s horizontal scroll visible?
Best Wishes,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Stoev,
Yes, the horizontal scroll bar is visible.
My sample code for constructing the grid is as follows:
var editrow = -1;
var labelWidth = globalWidth*1.7/8;
var attachpointWidth = globalWidth*1.3/8;
var limitWidth = globalWidth*1.1/8;
var startWidth = globalWidth*1.0/8;
var orderWidth = globalWidth*0.6/8;
var preWidth = globalWidth*0.9/8;
var editWidth = globalWidth*0.7/8;
var deleteWidth = globalWidth*0.7/8;
$("#blocks").jqxGrid(
{
width: globalWidth,
source: dataAdapter_block,
theme: theme,
height: 285,
sortable: true,
columnsresize: true,
showpinnedcolumnbackground: false,
showsortcolumnbackground:false,
ready: function () {
$("#blocks").jqxGrid('sortby', 'forsort', 'dec');
},
columns: [
{ text: 'id', dataField: 'id_block', hidden: true },
{ text: 'color', dataField: 'forsort', hidden: true },
{ text: 'forsort', dataField: 'color', hidden: true },
{ text: 'font_color', dataField: 'font_color', hidden: true },
{ text: 'Label', dataField: 'content', width: labelWidth, resizable: false, menu:false, sortable:false, pinned: true},
{ text: 'Attach. Point (US$m)', dataField: 'y_start', cellsformat: 'd', width: attachpointWidth },
{ text: 'Layer Limit (US$m)', dataField: 'height', cellsformat: 'f', menu:false, sortable:false, width: limitWidth },
{ text: 'Order Start %', dataField: 'x_start', cellsformat: 'f', menu:false, sortable:false, width: startWidth },
{ text: 'Order %', dataField: 'width', width: orderWidth, cellsformat: 'f', menu:false, sortable:false },
{ text: 'Premium (US$)', dataField: 'premium', cellsformat: 'f', menu:false, sortable:false, width: preWidth },
{ text: 'Edit', datafield: 'Edit', columntype: 'button', width:editWidth, , menu:false, sortable:false, resizable: false, cellsrenderer: function () {
return "Edit";
}, buttonclick: function (row) {}
},
{ text: 'Delete', datafield: 'Delete', columntype: 'button', width: deleteWidth, menu:false, sortable:false, resizable: false, cellsrenderer: function () {
return "Delete";
}, buttonclick: function (row) {}
},
]
});
And my code for adding a row after clicking the adding button is as follows:
$("#addrowbutton").bind('click', function () {
var datarow = generaterow();
$("#blocks").jqxGrid('addrow', null, datarow);
});
Thanks very much.
midiHi midi,
Thanks for the feedback. I will create a work item about this. Unfortunately, I cannot suggest you a workaround.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.