It's got to be in the docs somewhere, but here is the short version:
Ajax calls going out to the server specify, as part of post arguments, what call it is – Edit, or Del.
Now, If id element in Edit post is empty or some unrecognizable garbage, it's an Add. :
Something like that.
Don't know if this will give you much of an example, but here, in testing.js I play around with Add, Edit, Del ajax calls and explain some thing in the comments:
🙂 Hi Tony and the gang.
OlegK said:
Hello ddotsenko!
In the example on the http://www.accentsolution.com/static/jqgrid_localstore.html I could not find any loading of ui.multiselect.css and ui.multiselect.js. They must be explicit loaded before loading jqGrid (at least before grid.jqueryui.js) in your case before “/static/jquery.jqGrid_remote.js”.
Here is the example of that loads the multiselect JavaScript. In this case, the selector, as you can see, does not become “MultiSelect” It just stays as regular jQuery UI Dialog + selects inside.
http://www.accentsolution.com/static/jqgrid_multiselect.html
In my case, the style of multiselect is never applied to the selector.
Confirming the bug.
Line 38 ( this.container.remove();
There is really no code in jqGrid that manages a larger in-browser dataset, while displaying a subset in the grid. You have to write that code yourself. You override 'datatype' grid property with a function that does the fetching of the data subsets.
A very convoluted example of working against “Local storage” is here:
Re:
I was just wondering if there was a 'filters' property I could access that would give me the filters that are currently in use. I hope that is clear.
That's what I meant in my earlier post: you don't need a “function” or a “property” The filter data is stored in the postdata property in the grid. Just read it directly ( take a look at $('#gtid_id')[0].p.postdata in FireBug after setting the filters ) or use the jqGrid plug in that reads postdata.
Candrairawan78 said:
Dear all,
I have problem with multi selection delete, my code works on single delete but how to delete more than 1 . Could anyone help me please, I have spent over days trying to make this work and I have not solved my problem. This is my code:
if($operation == “del”)
{
$id=$_POST['id']; // the parameters show on firebug is id = 0909, 6787, 3521
$total=count($id);
for($i=0;$i<$total;$i++)
…
The contents of 'id' is not an array. It's a string. Split it into an array over “,”
The question is a bit confusing / ambiguous, but it looks like you are trying to Get search / filter settings from the grid, if any is set.
If this is so, just look at grid.p.postdata object. Depending on which search / filter method was used (simple, multiple, tabbar) the settings will be laid out in different way. On top of that, if the format is different based on true or false on stringResult property set for the search.
Example of “multiple search” format is here:
/jqgridwiki/doku.php?id=wiki:advanced_searching
Hope this is a right start for your search.
The starting point is that you need to give “deep” links to your data in 'name' properties on colModel. There are other issues (misspellings) but they are tertiary.
In your case colModel's names (in order they are in you example) should be:
|
1 2 3 4 5 6 |
colModel: [<br /> {name:'head.student_name', width:100},<br /> {name:'head.year', width:100},<br /> {name:'sub.date', width:100},<br /> {name:'sub.number', width:100}<br /> ] |
A DBA (or at least I) would have an issue with referring to data combination by multiple PKs.
A proper solution could be to inject unique ID for each data row and operate on that. In cases of working on “database views” or other results of joins, no one can rely all the time on a combination of IDs to be unique because various join conditions can duplicate the records like there is not tomorrow and filters may obscure that.
I suggest that server (SQL server, or web app code) keeps the mapping of columns-data-combination-to-unique-id in ORM (object relational mapper) or on DB. jqGrid (in my tests) supports GUIDs (UUIDs) as row IDs quite fine. Every time I feed a “view” each row has a GUID assigned to it by the server. When “edit” “delete” comes back to it, it knows exactly what data combination (row in a view) this refers to.
I was thinking about implementing the feature.
Local searching was possible for a long time.
You just have to decide what “local searching” means to you and implement override the “load” functionality through custom function. Per wiki and docs, 'grid.p.datatype' can be a function. All “load” requests, both with “filter” and without, are routed to it, instead of $.ajax when grid.p.datatype is a function.
Just parse the filter rules by hand in the browser and load the filtered data back into grid.
My definition of “make jqGrid work against local storage” is:
Have actual COMPLETE data sit in the browser. Say, an array with some 35 rows are attached to grid.p.dataStore.data.
Set up the function that reads paging, sorting, filtering arguments in the 'postdata' and returns proper subset of the data back (through a call-back like gridObj.addJSONData() )
jQuery's $.ajax.success() callback only sends 2 elements back:
|
1 2 3 4 |
function success(){<br /> // If a local callback was specified, fire it and pass it the data<br /> if ( s.success )<br /> s.success( data, status );<br /> |
XHR Obj is not sent back.
Sounds like what you are asking about is “Ability to populate Multiple Search dialog with default filters, preferably at the time grid is created”
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top