Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
jqGrid client-side data manipulation example.....
07/01/2010
20:40
Avatar
JeffDrummond
Member
Members
Forum Posts: 3
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

I am opening a jquery dialog with a jqGrid and initially populating

the grid with data from my controller.  This works fine.

I cannot use a pager with my grid, rather I have add and delete buttons

in a bar at the top of the grid.

Can someone point me to a grid example which includes code for

adding empty rows, editing those rows, deleting rows and saving

everything to the database in one transaction.

In my save function, I know how to gather information from the

grid and send it to my controller.  I'm most interested in the adding and editing

function, plus how to identify those rows deleted from the grid.

Thanks.

07/01/2010
22:34
Avatar
JeffDrummond
Member
Members
Forum Posts: 3
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

Hello:

I have added functionality to add, change and delete rows in the jqGrid in my jQuery dialog.

However, using the getChangedCells method continually returns an empty array.  Please

take a look at my grid and tell me what I am missing.  Thanks.

// Repairs grid definition.

$(”#repairsGrid”).jqGrid({

url:”../Controllers/GridController.aspx”,

datatype: 'json',

mtype: 'GET',

colNames:columnNames,

colModel:columnModel,

sortname: 'status',

jsonReader: {

root: “rows”,

page: “page”,

total: “total”,

records: “records”,

repeatitems:


false

,

id: “tir_tir_key”

},

rowNum:10,

rowList:[10,20,30],

loadonce:

true

,

loadui: “disable”,

viewrecords:

true

,

multiselect:

false

,

pgbuttons:

false

,

pgtext: “”,

altRows:

true

,

height: 200,

width: 550,

shrinkToFit:

true

,

caption: “Repairs”,

imgpath: imgPath,

onSelectRow: onSelectRowGrid,

cellEdit:

false

,

cellsubmit: 'clientArray',

editurl: “server.aspx”,

gridComplete:

function

(){

var

ids = jQuery(”#repairsGrid”).jqGrid('getDataIDs');

for(var

i=0;i < ids.length;i++){

var

cl = ids[i];

de = “<input style='height:22px;width:25px;' type='button' value='Del' onclick=\\”jQuery('#repairsGrid').delRowData('”+cl+”');\\” />”;

jQuery(”#repairsGrid”).jqGrid('setRowData',ids[i],{act:de});

}

}

});

// eof repairsGrid definition

10/01/2010
12:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

The getCahngedCells is able to work only in celEdit mode. It appears that you use inline editing, where this method is not applicable.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
60 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information