Thanks for the advice…
I now track which cell I am editing in the “beforeEditCell” and save the info in a global variable:
beforeEditCell: function (rowid, cellname, value, iRow, iCol) { _cellInEdit = { row: iRow, col: iCol }; }
I then use “afterSubmitCell” and, when needed, call:
grid.setRowData(rowid, info.Data, null);
to set the data for the entire row to the new data I just got from the server in “info.Data”.
In “afterSubmitCell” I also determine if the “_cellInEdit” is different from the one the “afterSubmitCell” was submitting. If it is different, user must have moved from one input cell to another… In that case, I restore the cell (sinces its value may have changed).
var newRow = _cellInEdit.row;
var newCol = _cellInEdit.col;
if (newRow != iRow || newCol != iCol) {
I would also like this.
I need to be able to cancel a cell edit event…
Thanks Tony.
Currently, I am reloading the entire grid after editing…
Is there any method that can be used to reload one row?
I can send the data from the server in any format that might be needed…
Thanks,
Glen
Another entry, to help others…
I had this line in my .jqGrid() initializer:
For the record, in case others wonder about this…
From the JQuery site linked by Tony:
JSON is a data-interchange format with syntax rules that are stricter than those of JavaScript's object literal notation. For example, all strings represented in JSON, whether they are properties or values, must be enclosed in double-quotes.
Thanks… this will help a lot.
More questions:
1) Please confirm: the JSON used in coding and the JSON used in the data work must be formatted differently?
2)
Here is the complete contents of a much shorter JSON response from the server:
{records:0,total:0,page:1,where:'Country is Bermuda, and Location is Boston',whereJson:'{“Country”:[“BMU”],”Location”:[“Boston”]}',rows:[]}
Even this response results in an “Invalid JSON” error.
I've added my own date validator, but it not being called…
Here is the column model:
{name:'HireDate',index:'HireDate',width:100,search:false,resizable:false,label:'Hire Date',groupName:'Legacy Data',classes:'editable',editable:true,align:'center',formatter:'date',datefmt:'M d, Y',editrules:{date:true,custom:true,custom_func:DateValidator},formatoptions:{newformat:'M d, Y',srcformat:'Y-m-d'}},
Is there any setting in there that would cause my DateValidator() to not be called?
Hi Tony,
This sounds reasonable… I'll try it soon.
Thanks for taking the time to answer this question, and all the other questions!
Glen
Thanks brecht
, this looks promising and I'll have to try it…
I'm using Cell Edit mode…
I have a column with:
I've also noticed that I cannot click on a check box to edit. I have to click beside it. (I'm using Cell Edit).
Please fix so that I can click directly on the check box to turn the cell into edit mode.
Is there a quick fix I can do before it is fixed?
Glen
Thanks Tim.
(I posted my entry immediately after yours, and didn't see yours…)
This is what I have now, and it is working:
function GridComplete() {
Here's what I've tried…
function BeforeCellEdit(rowid, cellname, value, iRow, iCol) {
Hi,
Can anyone give any ideas for this?
Thanks,
Glen
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top