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
Edit Commands Buttons

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

Edit Commands Buttons

This is a really simplified demo of how one could add visible editing functionality to jqGrid (have in mind that jqGrid has the built-in navGrid feature that provides similar functionlity).

What we do here is we add a new column to jqGrid that never gets any data. Instead we use a custom formatter to dynamically generate buttons in that column that could perform the basic edit commands.

You can find the code below. The custom formatter that generates the buttons is the displayButtons function.

        $(document).ready(function () {
            'use strict';
             var gidData = [
                    {action:"", id: "1", orderdate: "2013-10-01", customer: "customer",  price: "200.00", vat: "10.00", completed: true, shipment: "TN", total: "210.00"},
                    {action:"", id: "2", orderdate: "2013-10-01", customer: "customer2",  price: "300.00", vat: "20.00", completed: false, shipment: "FE", total: "320.00"},
                    {action:"", id: "3", orderdate: "2011-07-30", customer: "customer3",  price: "400.00", vat: "30.00", completed: false, shipment: "FE", total: "430.00"},
                    {action:"", id: "4", orderdate: "2013-10-04", customer: "customer4",  price: "200.00", vat: "10.00", completed: true, shipment: "TN", total: "210.00"},
                    {action:"", id: "5", orderdate: "2013-11-31", customer: "customer5",  price: "300.00", vat: "20.00", completed: false, shipment: "FE", total: "320.00"},
                    {action:"", id: "6", orderdate: "2013-09-06", customer: "customer6",  price: "400.00", vat: "30.00", completed: false, shipment: "FE", total: "430.00"},
                    {action:"", id: "7", orderdate: "2011-08-30", customer: "customer7",  price: "200.00", vat: "10.00", completed: true, shipment: "TN", total: "210.00"},
                    {action:"", id: "8", orderdate: "2013-10-03", customer: "customer8",  price: "300.00", vat: "20.00", completed: false, shipment: "FE", total: "320.00"},
                    {action:"", id: "9", orderdate: "2013-09-01", customer: "customer9",  price: "400.00", vat: "30.00", completed: false, shipment: "TN", total: "430.00"},
                    {action:"", id: "10", orderdate: "2013-09-08", customer: "customer10", price: "702.00", vat: "30.00", completed: true, shipment: "IN", total: "530.00"},
                    {action:"", id: "11", orderdate: "2013-09-08", customer: "customer11",  price: "500.00", vat: "30.00", completed: false, shipment: "FE", total: "530.00"},
                    {action:"", id: "12", orderdate: "2013-09-10", customer: "customer12",  price: "500.00", vat: "30.00", completed: false, shipment: "FE", total: "530.00"}
                ],
                theGrid = $("#theGrid"),
                numberTemplate = {formatter: 'number', align: 'right', sorttype: 'number'}

        
            theGrid.jqGrid({
                datatype: 'local',
                data: gidData,
                colNames: ['Action','Customer', 'Date',  'Price', 'VAT', 'Total', 'Completed', 'Shipment'],
                colModel: [
                	  {name:'action',index:'action',sortable:false, formatter: displayButtons},
				    	  {name: 'customer', index: 'customer', width: 90, editable:true},
                    {name: 'orderdate', index: 'orderdate', width: 100, align: 'center', sorttype: 'date',
                        formatter: 'date', formatoptions: {newformat: 'd-M-Y'}, datefmt: 'd-M-Y'},
                    {name: 'price', index: 'price', width: 55, template: numberTemplate},
                    {name: 'vat', index: 'vat', width: 42, template: numberTemplate},
                    {name: 'total', index: 'total', width: 50, template: numberTemplate},
                    {name: 'completed', index: 'completed', width: 30, align: 'center', formatter: 'checkbox',
                        edittype: 'checkbox', editoptions: {value: 'Yes:No', defaultValue: 'Yes'}},
                    {name: 'shipment', index: 'shipment', width: 80, align: 'center', formatter: 'select',
                       edittype: 'select', editoptions: {value: 'FE:FedEx;TN:TNT;IN:Intime;us:USPS', defaultValue: 'Intime'}}                  
                ],
				gridview: true,             
				rownumbers: false,
                rowNum: 10,
                rowList: [5, 10, 15],
                pager: '#gridPager',
                viewrecords: true,	
                caption: 'Edit Commands Buttons',
                height: '100%'
            });
        });
        
        function displayButtons(cellvalue, options, rowObject)
			{
    			var edit = "<input style='...' type='button' value='Edit' onclick=\"jQuery('#theGrid').editRow('" + options.rowId + "');\"  />", 
					 save = "<input style='...' type='button' value='Save' onclick=\"jQuery('#theGrid').saveRow('" + options.rowId + "');\"  />", 
					 restore = "<input style='...' type='button' value='Restore' onclick=\"jQuery('#theGrid').restoreRow('" + options.rowId + "');\" />";
				return edit+save+restore;
			}

 


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: 3 years 1 month ago by chandu #509

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
chandu's Avatar
By using above code it is saving locally, I need to edit and save in sql database. Please help.

Thanks,
Chandu
Posted: 1 month 1 week ago by dongbei #9875

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
North Face Jackets ,
Polo Ralph Lauren Outlet ,
kate spade outlet ,
Ray Ban Sunglasses ,
Kate Spade Handbags Outlet ,
Tory Burch Outlet Store ,
Coach Outlet Online ,
Ray Ban Sunglasses Outlet ,
Coach Factory Outlet ,
Oakley Sunglasses Outlet ,
Coach Outlet ,
Moncler Jackets Outlet ,
Fitflop Sandals ,
Prada Handbags ,
Coach Outlet ,
Michael Kors Bags Outlet ,
Tory Burch Outlet Store ,
Ray Ban Outlet ,
oakley sunglasses outlet ,
North Face Jackets Outlet ,
Burberry Outlet ,
Michael Kors Outlet ,
Polo Outlet ,
Longchamp Outlet ,
Swarovski Jewelry Outlet ,
Oakley Sunglasses ,
Timberland ,
longchamp handbags ,
Ray Ban Sunglasses ,
Cheap Jordans ,
Timberland Outlet ,
Kate Spade Handbags ,
Oakley Sunglasses ,
Air Jordans ,
Pandora Bracelets ,
Ray Ban Sunglasses ,
Salomon Outlet ,
Nike Outlet Store ,
Converse Shoes ,
Adidas Outlet ,
Tommy Hilfiger Shirts ,
New Balance Shoes Outlet ,
Asics Shoes ,
Giuseppe Zanotti Outlet ,
Polo Ralph Lauren Outlet ,
Polo Ralph Lauren Shirts ,
Coach Outlet ,
Coach Outlet ,
Cheap Oakley Outlet ,
Louboutin Outlet ,
Ralph Lauren Outlet ,
Cheap Ray Ban Sunglasses ,
Coach Outlet Store Online ,
Coach Factory Outlet Online ,
Coach Outlet Online ,
Coach Outlet ,
Michael Kor Factory Outlet ,
Michael Kors Outlet Online ,
Michael Kors Outlet ,
Michael Kors Factory Outlet Online ,
michael kors outlet ,
Coach Outlet Clearance ,
Michael Kors Online ,
Coach Outlet online ,
Michael Kors Outlet Online ,
nike shoes ,
nike outlet ,
cheap Jordan ,
retro jordan shoes ,
tory burch outlet ,
tory burch sale ,
oakley outlet online ,
cheap oakley sunglasses ,
ray ban outlet online ,
ray ban sunglasses outlet ,
coach outlet ,
the north face outlet ,
Michael Kors Bags ,
true religion jeans ,
Ed Hardy Clothing Outlet ,
Under Armour Outlet Store ,
Air Jordans Shoes ,
Christian Louboutin Outlet ,
Nike Factory Outlet ,
coach outlet ,
Coach Factory Outlet ,
north face jackets ,
Coach Outlet ,
kate spade handbags ,
coach factory outlet ,
Coach Outlet Store Online ,
Michael Kors Outlet Online ,
Cheap Ray Ban ,
Coach Outlet Store Online ,
nba jerseys ,
ray ban sunglasses ,
cheap jerseys from china ,
oakley sunglasses store ,
Michael Kors outlet ,
Ray Ban Eyeglasses ,
michael kors outlet canada ,
oakley sunglasses ,
Coach Factory Outlet ,
Michael Kors Outlet Online ,
sac longchamp pas cher ,
mont blanc michigan ,
louboutin ,
Fitflop Shoes ,
coach factory outlet online ,
sac longchamp paris ,
coach outlet online ,
polo outlet ,
Polo Ralph Lauren Outlet Store ,
yeezy boost 350 ,
Red Bottom Shoes ,
adidas nmd ,
Christian Louboutin Outlet ,
true religion outlet ,
true religion jeans outlet ,
Pandora Jewelry ,
Ferragamo Shoes ,
yeezy boost 350 ,
adidas nmd R1 ,
true religion jeans ,
air jordan shoes ,
[url=http://www.jordan--shoes.us.com/]jordan shoes for sale[/url] ,
oakley vault ,
vans outlet ,
Coach Outlet Online ,
nike store ,
uggs ,
Uggs Outlet ,
pandora charms ,
Nike Air Max 2017 ,
Coach factory outlet ,
Kate Spade Handbags ,
mont blanc ,
Prada ,
swarovski outlet ,
UGG Australia ,
Salomon Shoes ,
Moncler ,
montblanc pen sale ,
moncler ,
burberry ,
Vans Store ,
under armour outlet ,
the north face ,
longchamp sale ,
fitflop sale ,
swarovski crystal ,
polo ralph lauren ,
timberland shoes ,
ugg store ,
polo ralph lauren ,
timberland boots ,
Nike Shoes ,
nba jerseys sale ,
nhl jerseys ,
under armour outlet ,
Coach Outlet ,
nfl jerseys wholesale ,
Christian Louboutin Sneakers ,
Adidas NMD ,
red bottom shoes ,
cheap jerseys china ,
coach purses ,
ugg outlet ,
nike air max 2017 ,
red bottoms louboutin ,
Adidas Outlet Store ,
Christian Louboutin ,
ugg boots on sale ,...
michael kors outlet online ,