jQuery UI Widgets › Forums › Grid › Grid inside jqxWindows freezed
This topic contains 5 replies, has 2 voices, and was last updated by yllsuarez 10 years, 2 months ago.
-
Author
-
Hi, there !!
I have a grid and when select a row open a jqxWindows with other grid inside.
All is going fin untill close the jqxWindows and open the jqxWindows from other row. The Windows open, but the grid dont allow me select nothing.
Hello yllsuarez,
Please make sure you initialize the grid in the window in the jqxWindow’s initContent callback function. This way, you can avoid unexpected behaviour.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
I don’t know exactly where initialize the jqWindow. I need send some parameters in order to build the jqGrid inside the jqWindow.
I am defining the jqWindow in the ready() function as follow:
$(“#popupWindow”).jqxWindow({ width: 600, height: 400, isModal: true, autoOpen: false, cancelButton: $(“#Cancel”), modalOpacity: 0.01 });So, the popupWindow is called through this function:
function ShowRowDetails(typeTask, dataRecord) {
BuildReportedGrid( typeTask, dataRecord);
$(“#popupWindow”).jqxWindow(‘show’);
}In BuildReportedGrid I populated a grid, that, as I said before the first show the real data, after that never refresh or repaint the jqWindows.
Hi yllsuarez,
Here is what we suggest:
$("#popupWindow").jqxWindow({ width: 600, height: 400, isModal: true, autoOpen: false, cancelButton: $("#Cancel"), modalOpacity: 0.01, initContent: function() { // initialize the grid here (with empty data if initial data is not known) } }); function ShowRowDetails(typeTask, dataRecord) { // update the grid's data here (by setting its source or calling updatebounddata). Do not call the grid initialization code here BuildReportedGrid(typeTask, dataRecord); $("#popupWindow").jqxWindow('show'); }
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar, thanks a lot for ur time.
I follow your suggestion, but the grid is still showed the first time nice, but the others time that is called the data is not refreshed.
I am using the code below,
$(“#MenuTasks”).on(‘itemclick’, function (event) {
var args = event.args;
var rowindex = $(“#assignedtask”).jqxGrid(‘getselectedrowindex’);
var dataRecord = $(“#assignedtask”).jqxGrid(‘getrowdata’, rowindex);switch ( $.trim($(args).text()) ) {
case “Edit Tasks Reported”:
BuildReportedGrid( “Task”, dataRecord);
$(“#popupWindow”).jqxWindow(‘show’);
break;
case “New Task Report”:
NewWSWindows(“Task”, dataRecord);
break;
}
});//Initialize PopMenu for grids
$(“#popupWindow”).jqxWindow({
width: 600, height:
400, resizable: true,
isModal: true,
autoOpen: false,
cancelButton: $(“#Cancel”),
modalOpacity: 0.01,
animationType: ‘fade’,
initContent: function() {
$(“#reportedgrid”).jqxGrid({
width: 550,
//source: weeklysource,
autoHeight: true,
sortable: true,
showstatusbar: true,
statusbarheight: 50,
showfilterrow: true,
filterable: true,
showaggregates: true,
selectionmode: ‘singlerow’,
columns: [
{ text: ‘ID’, datafield: ‘id’},
{ text: ‘Task’, datafield: ‘title’, columntype: ‘textbox’, filtertype: ‘input’, width: 400 },
{ text: ‘Report’, datafield: ‘effort’ , cellsalign: ‘right’ , width: 90 , aggregates: [‘sum’]}
]
});
}
});function BuildReportedGrid( reportype, datarow) {
var currentws = _.where(myweekly, { updtype: reportype, title: datarow.title} );
var weeklysource = {
localdata: currentws,
datafields:
[
{ name: ‘id’ , type: ‘number’ },
{ name: ‘title’, type: ‘string’ },
{ name: ‘effort’ , type: ‘number’ }
],
datatype: “array”
};$(“#reportedgrid”).jqxGrid({ source: weeklysource });
}
Dimitar, when include an Adapter instead of the array source all became clear.
Thanks a lot.
-
AuthorPosts
You must be logged in to reply to this topic.