This bug is corrected. Maybe you have a older copy of jqGrid. Download the last revision from:
http://www.trirand.com/jqgrid/js/jquery.jqGrid.js
Ashish Sharma,
with a little modifications and some tricks maybe you can do this in easy way.
I have updated the saveRow function. Now the full parametres are:
saveRow(rowid, succesfunc, url, extraparam, aftersavefunc) where:
rowid is the id of the row;
successfunc – this function accept the server response and should return true or false if the update is ok. If not set the default return value is true. This function is called before the actual update of the grid data (client side);
url – you can specify other url, which override the editurl parameter – default null;
extraparam – this is a array with extra parameters, than can be passed to the server;
aftersavefunc(rowid,serverResponse) – to this function are passed two parameters – the id of the row and the response from the server and is called after update the data (client side)
So in your case you should use aftersavefunc.
The trick is that you should return the needed data from the server after the update and use it in aftersavefunc to update the fields in the row.
You can download the updated revision from:
http://www.trirand.com/jqgrid/js/jquery.jqGrid.js
Note that the demo package and jqGrid files are not updated.
P.S. I do not have make the full tests, so if you encounter any error please let me known
Regards
Tony
Ashish Sharma,
Could you please describe in more detail what you try to do?
Which methods do you use?
If possible please post a code.
Aha,
Here is your problem (it is actually not a problem):
function action(){
id = jQuery(“#element”).getSelectedRow();
jQuery.get(); // ajax call to my server (update data), no return data;
jQuery(“#element”).trigger(“reloadGrid”); // refresh grid after ajax call
}
You make two ajax call – the first is to update data and the second is to retrieve it. Since the calls are asynchrounus it is not known which is the first – the update or the read.
To resolve the problem you should make something like this:
function action(){
id = jQuery(“#element”).getSelectedRow();
jQuery.get(…,async:false,…); // ajax call to my server (update data), no return data;
jQuery(“#element”).trigger(“reloadGrid”); // refresh grid after ajax call
}
Or the clear method is:
You should known if the data is updated with success from the server – i.e in your get function you should return some information on what is happen – if the update is ok then call reload grid.
Regards
Ok,
I figured it.
Download the last revision from:
http://www.trirand.com/jqgrid/js/jquery.jqGrid.js
You do not need to specify in the url new Date.
Please let me known for the result
Regards
Tony
Hi Laurent,
In my pages I specify in the url option:
…
url:’mypage.php?nd=’+new Date().getTime(),
…
This prevent the caching.
I think that this trick should be added in the jqGrid.
Please tell me if you continue to have problems after adding a new Date.getTime()
Regards
Tony
In the final release I plan to have onSelectRow when a multiselect is true.
This callback will accept two parameters (iRow, selected) where iRow is the id of row and selected will be the state if the row is selected – true if selected false if unselect.
Having this you can construct you own array (add selected and remove unselected) with selected values using onSelectRow.
Regards
Tony
Hi Jonathan,
This is good idea, but not applicable when reading data from xml after moving columns – ie the xml is
data
…
datan
In this case data will be placed not in the right column.
Instead of that I will think for this in the next release (not in this)
Tony
Sorry about this. I forgot to update the demo package with last version.
Now you can download the package and test
Tony
Jonathan,
This can be done using a searchdb plugin. I have updated this plugin so it can be integrated with the jqGrid. The updated version of serchdb support dropdown 🙂
In the moment I work hard on documentation and integration with other plugins like serchdb, jqModal, datePicker…
A lot of examples will be published soon
Tony
Jonathan,
This is done and should be published soon. I have add a textarea and checkbox too.
Tony
Currently you can not do this.There are no actions attached to the subgrid row if you click or dblclick. This is a good idea on how we can operate on subgrid in the future. Any ideas will be wellcome.
Regards
Tony
Thanks for recommendation. I will see what I can do
Tony
Thanks for that.
The same should be for xml too. I have change little the reading of subgrid – in this case this checking is not needed.
Tony
Thanks,
This feature is added to the final release.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top