Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/string/string.php on line 28

Deprecated: iconv_set_encoding(): Use of iconv.input_encoding is deprecated in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/string/string.php on line 29

Deprecated: iconv_set_encoding(): Use of iconv.output_encoding is deprecated in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/string/string.php on line 30

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652
Remote Data - Local Filter/Sort/Select Part 2

Deprecated: Non-static method PhocaGalleryPath::getPath() should not be called statically, assuming $this from incompatible context in /home/datamerx/public_html2/codemerx/jqgrid/plugins/content/phocagallery/phocagallery.php on line 57

Deprecated: Non-static method PhocaGalleryPath::getInstance() should not be called statically, assuming $this from incompatible context in /home/datamerx/public_html2/codemerx/jqgrid/administrator/components/com_phocagallery/libraries/phocagallery/path/path.php on line 36

Deprecated: Non-static method PhocaGalleryLibrary::getLibrary() should not be called statically, assuming $this from incompatible context in /home/datamerx/public_html2/codemerx/jqgrid/plugins/content/phocagallery/phocagallery.php on line 64

Deprecated: Non-static method PhocaGalleryLibrary::getInstance() should not be called statically, assuming $this from incompatible context in /home/datamerx/public_html2/codemerx/jqgrid/administrator/components/com_phocagallery/libraries/phocagallery/library/library.php on line 44

Deprecated: Non-static method PhocaGalleryPath::getPath() should not be called statically, assuming $this from incompatible context in /home/datamerx/public_html2/codemerx/jqgrid/plugins/content/phocagalleryslideshow/phocagalleryslideshow.php on line 40

Deprecated: Non-static method PhocaGalleryPath::getInstance() should not be called statically, assuming $this from incompatible context in /home/datamerx/public_html2/codemerx/jqgrid/administrator/components/com_phocagallery/libraries/phocagallery/path/path.php on line 36

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652

Remote Data - Local Filter/Sort/Select Part 2

  • Step 3 - Preserving the Sorting on Edit

So, when we do $(this).jqGrid('setGridParam', {datatype:'json'}).trigger('reloadGrid'); in step 2 all the data gets downoaded from the server again and jqGrid gets recreated. Naturally, any local sorting the user did will e gone at this point.

It is possile to save the sorting settings locally and re-sort jqGrid the same way after reload. A much better strategy, however, is tosort the data on the server side before sending it to jqGrid. Luckily, jqGrid sends the most sorting settings to the server using the sord and sidx URL parameters. The sidx (sort index) parameter is initialized to the column index (colModel index property) of the sorted column and sord (sort order) is initialied to either 'asc' ord 'desc' depending on the most recent sort order.

  • Step 4 - Preserving the Selected Row

If the user selected a row i jqGrid by clicking on it that selecion will get lost in two casesof our scenario:
- Local sort on a grid column
- Add/edit grid data, i.e. data reload

This demo shows how to deal with the first case. Rather unfortunately, it will not work in the second case. So, we need a different appoach.

Saving the selected row in jQuery cache should keep us on the safe side even when grid data gets reloaded. So let's explore this approach further.

These two functions save the selected row index in the jQuery cache of the grid <table> element.

var saveSelectedRow = function () 
{
$(this).data("selectedRow", $(this).jqGrid('getGridParam', 'selrow'));
};

var restoreSelection = function () 
{
$(this).jqGrid("setSelection", $(this).data('selectedRow');
};

These functions need to get called before the selection gets lost and after all the data is loaded. The demo  mentioned above defines pretty good hooks in case of local soting

$("#myGrid").jqGrid({
.....
onSortCol: saveSelection,
loadComplete: restoreSelection
.....
});

In case of adding/editing data we'll have to duse the grid tion properties as follows:

 

$("#myGrid").jqGrid('navGrid',"#myNavigation", {edit:true, add:true},
{
//On Edit
afterSubmit: function() { saveSelectedRow.call(this); return [true,,]; },
afterComplete: refresh,
},
{
//On Add
afterSubmit: function() { saveSelectedRow.call(this); return [true,,]; },
afterComplete: refresh,
});

var refresh = function() 
{
$(this).jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');
restoreSelection.call(this);
};

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652
Posted: 1 month 1 week ago by dongbei #9867

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652
dongbei's Avatar
ray ban sunglasses ,
ray ban outlet ,
coach outlet store ,
the north face Jackets ,
Michael Kors Outlet Store Online ,
Coach Outlet Online ,
north face outlet ,
Coach Outlet Online Store ,
kate spade outlet store ,
coach outlet store ,
Coach Outlet Store ,
polo ralph lauren ,
Polo Outlet ,
adidas yeezy boost 750 ,
Red Bottom Shoes ,
adidas nmd runner ,
Cheap Christian Louboutin ,
cheap true religion outlet ,
true religion jeans ,
Pandora Bracelet ,
Salvatore Ferragamo Shoes ,
The North Face Outlet ,
Polo Ralph Lauren ,
Kate spade outlet online ,
Ray Ban outlet ,
Kate Spade Outlet Store ,
Tory Burch Outlet ,
Coach Outlet ,
Ray Ban Outlet Store ,
Coach Outlet ,
Oakley Sunglasses ,
Coach Bags Outlet ,
Moncler sale ,
Fitflop Sandals ,
Prada Outlet ,
Coach Factory Outlet Store ,
Michael Kors Handbags Outlet ,
Tory Burch ,
Ray Ban Outlet Store ,
cheap oakley outlet ,
The North Face Outlet ,
Burberry Outlet ,
Michael Kors Outlet Online ,
Polo Ralph Lauren ,
longchamp bags ,
Swarovski Jewelry ,
Cheap Oakley Sunglasses ,
Timberland Outlet ,
longchamp ,
Ray Ban Sunglasses ,
Jordan Shoes ,
Timberland Boots ,
Kate Spade Handbags Outlet ,
Oakley Sunglasses ,
Cheap Jordans ,
Pandora Charms ,
Ray Ban Sunglasses ,
Salomon Shoes Outlet ,
Nike Outlet ,
Converse Outlet ,
Adidas Yeezy Shoes ,
Tommy Hilfiger Polos ,
New Balance ,
Cheap Asics Shoes ,
Coach Factory Outlet ,
Coach Outlet ,
Coach Outlet Stores ,
Coach Factory Outlet ,
Michael Kor Outlet Online ,
Michael Kors Factory Outlet ,
Michael Kors Outlet Store Online ,
Michael Kors Outlet ,
michael kors outlet online ,
Coach Outlet online ,
Michael Kors Handbags ,
Coach Handbags Outlet ,
Michael Kors US ,
nike air max ,
cheap nike shoes ,
air jordan shoes ,
cheap air Jordan ,
tory burch outlet stores ,
Giuseppe Zanotti Shoes ,
Polo Ralph Lauren Shirts ,
Ralph Lauren Outlet ,
Coach Outlet Store ,
Coach Handbags Outlet ,
Cheap Oakley ,
Christian Louboutin Outlet ,
Polo Ralph Lauren ,
Ray Ban Sunglasses ,
Coach Outlet ,
Cheap nba jerseys ,
ray ban eyeglasses ,
cheap jerseys baseball ,
oakley sunglasses ,
Michael Kors Handbags ,
Ray-Ban Sunglasses Outlet ,
michael kors bags ,
oakley sunglasses ,
Coach Factory Outlet Online ,
Michael Kors Handbags ,
sac longchamp pliage ,
mont blanc ,
chaussures louboutin ,
Fitflops Sale Clearance ,
coach outlet online ,
longchamp ,
coach outlet store online ,
Ray Ban Sunglasses Outlet ,
true religion outlet store ,
Ed Hardy Outlet ,
Under Armour Outlet Online ,
Cheap Jordans 11 ,
swarovski jewelry ,
Cheap UGGS ,
Christian Louboutin Outlet ,
Nike Outlet ,
coach outlet online ,
Michael Kors Handbags ,
tory burch shoes ,
oakley sunglasses ,
oakley outlet ,
adidas yeezy boost 350 v2 ,
adidas nmd ,
true religion ,
jordan shoes 11 ,
[url=http://www.jordan--shoes.us.com/]cheap jordan shoes[/url] ,
oakley sunglasses ,
vans shoes ,
Coach Outlet Store ,
nike outlet store ,
uggs outlet ,
Ugg Australia ,
pandora jewelry charms ,
Air Max 90 ,
Coach outlet ,
Kate Spade ,
montblanc pen ,
Prada Handbags ,
Salomon Outlet ,
Moncler Jacket Outlet ,
Mont blanc Pens ,
Moncler Outlet ,
burberry sale ,
Vans Shoes ,
under armour shoes ,
north face ,
longchamp ,
fitflops sale clearance ,
swarovski jewelry ,
polo outlet ,
Timberland Outlet ,
ugg outlet ,
ralph lauren ,
timberland shoes ,
Cheap Jerseys ,
Nike Outlet Store ,
nba jerseys ,
nhl jerseys sale ,
under armour shoes ,
Coach Outlet Online ,
authentic nfl jerseys ,
Christian Louboutin Outlet ,
Adidas NMD Mens ,
red bottom heels ,
cheap jerseys sale ,
coach purses outlet online ,
ugg boots ,
nike air max ,
red bottom heels ,
Adidas Outlet ,
Christian Louboutin Shoes ,
ugg boots for women ,
michael kors outlet ,
..

   

Social Login  


 
   

Your Cart  


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652
The cart is empty
   

Latest Forum Posts  


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/codemerx/jqgrid/libraries/joomla/filter/input.php on line 652