Forum
15:31
08/03/2009
I have a grid with cellEdit set to true, and no custom editing callbacks at all. I'm having a problem with the following sequence:
- Select cell 1 (edit box opens) and make a change
- Select cell 2 (first edit box closes, red triangle appears, server request is made, second edit box opens)
- Select cell 1 again
At this point, I would expect the second edit box to close, a server request to be made, and the first edit box to reopen. However, what actually happens is that the first edit box reopens without the second one closing or a server request being made. At this point, I'm effectively editing two cells at once, though I can never get the second one to commit its changes.
Anybody have any idea how to make this stop happening? On a related note, anybody have any idea how to get rid of the damn red triangle after I've committed the changes to the server? I don't really understand the purpose of the red triangle, but I have no need to tell the user that they've just changed a cell.
Thanks,
Aaron
00:33
Moderators
30/10/2007
Hello,
What version of jqGrid do you use and on wich browser is this situation?
Could you please send a link to the problem, or at least post the grid configuration?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
17:45
08/03/2009
I'm using jqGrid 3.4.1, and this is on Firefox 3.0.7 on the Mac. The page isn't hosted externally yet, but here's the grid configuration (note that I tried removing the callbacks, and it didn't solve the problem):
$('#items').jqGrid(
{
// Original data request
url:'Main.php',
postData: {"action":"requestItems", "selectedUserID":selectedUserID},
// Grid attributes
caption: "Items",
imgpath: "lib/jqGrid/themes/basic/images",
hidegrid: false,
datatype: 'json',
mtype: 'POST',
height: "100%",
// Columns
colNames:['Name', 'Category', '#Req', 'Price'],
colModel:
[
{
name:'item_name',
index:'item_name',
width:150,
sortable:true,
editable:true,
},
{
name:'item_category',
index:'item_category',
sortable:true,
editable:true
},
{
name:'num_requested',
index:'num_requested',
width:100,
sortable:true,
editable:true
},
{
name:'item_price',
index:'item_price',
width:100,
sortable:true,
editable:true
}
],
// Editing
cellEdit: true,
cellurl: "Main.php",
beforeSubmitCell: onGridCellEditCommitting,
afterSaveCell: onGridCellEditEnded,
afterSubmitCell: onGridCellEditComplete,
// Selection
multiselect: true,
onCellSelect: onSelectItem,
// Other callbacks
loadComplete: onGridLoadComplete
});
Thanks,
Aaron
05:49
Moderators
30/10/2007
Hello,
Could you please try with FF on Windows or with Safari?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
14:35
08/03/2009
Sorry for the delay, this is a personal project so I have to work around the damn job. 🙂
The behavior is exactly the same in FF (3.0.7) for Windows. Here's a screen shot:
Unfortunately, my site is badly broken in Safari and IE at the moment, so I can't try it there.
Any suggestions?
Thanks,
Aaron
10:41
Moderators
30/10/2007
Hello,
I see onCellSelect event - this is not connected with cell editing. Instead could you please try to use onSelectCell instead
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
20:24
08/03/2009
I tried various combinations of this, with no effect. The callbacks have nothing to do with this behavior - it still occurs with this grid definition:
ownGrid.jqGrid(
{
// Original data request
url:'Main.php',
postData: {"action":"requestItems", "selectedUserID":selectedUserID},
// Grid attributes
caption: "Items",
imgpath: "lib/jqGrid/themes/basic/images",
hidegrid: false,
datatype: 'json',
mtype: 'POST',
height: "100%",
// Columns
colNames:['Name', 'Category', '#Req', 'Price'],
colModel:
[
{
name:'item_name',
index:'item_name',
width:150,
sortable:true,
editable:true
},
{
name:'item_category',
index:'item_category',
sortable:true,
editable:true
},
{
name:'num_requested',
index:'num_requested',
width:100,
sortable:true,
editable:true
},
{
name:'item_price',
index:'item_price',
width:100,
sortable:true,
editable:true
}
],
// Editing
cellEdit: true,
cellurl: "Main.php",
// beforeSubmitCell: onGridCellEditCommitting,
// afterSaveCell: onGridCellEditEnded,
// afterSubmitCell: onGridCellEditComplete,
// Selection
multiselect: true,
// onCellSelect: onSelectItem,
// onSelectCell: onSelectItem,
// Other callbacks
// loadComplete: onGridLoadComplete
});
Also, looking at the code, I see onCellSelect but not onSelectCell, at least in grid.base.js. Am I missing something?
Thanks,
Aaron
09:34
08/03/2009
OK, I know what's going on, but I don't know why this (presumably) works for everyone else. Here's the sequence (all line numbers refer to grid.celledit.js):
- select cell 1
editCell is called
line 43: length == 0, so no call is made to saveCell or restoreCell
line 79: savedRow is assigned
- modify cell 1
- select cell 2
editCell is called
line 43: length == 1, so saveCell is called
saveCell performs a POST
line 79: savedRow is assigned
saveCell POST complete callback is triggered
line 205: savedRow cleared
- select cell 3
editCell is called
line 43: length == 0, so no call is made to saveCell or restoreCell
So, the problem is the ordering of the assignment to savedRow on line 79 and the POST complete callback, which clears that variable. Since the callback occurs after the assignment, savedRow ends up clear, and the next call to editCell doesn't call restoreCell, so the edit box doesn't get removed.
Any idea what to do about this?
Thanks,
Aaron
01:55
Moderators
30/10/2007
Hello,
Do you have any other content within a cell? I mean other html tags.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
19:51
08/03/2009
Here's the content that's (currently) getting put into the grid:
{
"page":1,
"total":1,
"records":6, "rows":[
{"id":"6","item_name":"Item2d","item_category":"Cat2 modified",
"num_requested":"1","item_price":"$1"},
{"id":"5","item_name":"Item1","item_category":"Cat1 mod",
"num_requested":"1-3","item_price":"$2"},
{"id":"7","item_name":"Item3a","item_category":"George",
"num_requested":"1","item_price":"$3"},
{"id":"20","item_name":"item13","item_category":"Cat13",
"num_requested":"","item_price":""},
{"id":"21","item_name":"item14","item_category":"Cat14",
"num_requested":"","item_price":""},
{"id":"22","item_name":"item15","item_category":"",
"num_requested":"","item_price":""}
]
}
So, no.
Thanks,
Aaron
10:51
Moderators
30/10/2007
Hello,
I Will test this having this information - using your config and data.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
13:18
08/03/2009
Here's the simplest code I can come up with that illustrates the problem.
<html>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"></meta>
<!-- Library scripts -->
<script type="text/javascript" src="lib/jquery-1.3.2.js"></script>
<script type="text/javascript" src="lib/jqGrid/jquery.jqGrid.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
$('#grid').jqGrid(
{
datatype: 'clientSide',
// Columns
colNames:['Name'],
colModel:
[
{
name:'item_name',
index:'item_name',
editable:true
}
],
// Editing
cellEdit: true,
cellurl: "Main.php"
});
var data =
[
{ item_name: "Item1"},
{ item_name: "Item2"},
{ item_name: "Item3"}
];
for (var cnt = 0; cnt < data.length; ++cnt)
$('#grid').addRowData(cnt, data[cnt]);
});
</script>
</head>
<body>
<table id="grid"></table>
</body>
</html>
Recall that I'm running under Firefox 3.0.8 on the Mac. Please offer any insight you can - if this can't be fixed, I'm not going to be able to use jqGrid, and I'd really rather not have to try to integrate a different grid control at this point.
Thanks,
Aaron
03:17
Moderators
30/10/2007
Hello,
Thanks for investigation.
Humm - in my FF 3.0.8 on Windows all seems to work ok.
To use the cell editing local add
cellsubmit: 'clientArray' - see docs
Could you plese test this sample on Windows machine?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
07:01
08/03/2009
If you'd like me to examine some internal state of the jqGrid code, I'd be happy to help out. Given that I can reproduce this 100% and you can't, it might make more sense to try to debug it remotely.
Another possibility would be to do some sort of a screen-sharing thing and debug it live, or even just to use VNC for you to debug it directly on my machine.
Please let me know how I can help.
Thanks,
Aaron
Most Users Ever Online: 715
Currently Online:
55 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66