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
undefined GetRowData
23/02/2009
07:28
Avatar
PeterB
Member
Members
Forum Posts: 8
Member Since:
03/02/2009
sp_UserOfflineSmall Offline

Tony I have a grid which I want to edit the items in each row when finished the user clicks the "Submit Changes" button as below :-

     $('#RAGroupData').jqGrid({
        url: url,
        datatype: 'json',
        mtype: 'GET',
        colNames: ['Group Name', 'Max Quantity', 'Position Limit', 'Position Offset'],
        colModel: [{ name: 'GroupName', index: 'GroupName', width: 120, align: 'center', editable: false, sortable: true },
                   { name: 'MaxQuantity', index: 'MaxQuantity', width: 120, align: 'center', editable: true, sortable: true, formatter: 'integer' },
                   { name: 'PositionLimit', index: 'PositionLimit', width: 120, align: 'center', editable: true, sortable: true, formatter: 'integer' },
                   { name: 'PositionOffset', index: 'PositionOffset', width: 120, align: 'center', editable: true, sortable: true, formatter: 'integer'}],
        sortname: 'GroupName',
        sortorder: "desc",
        width: 1000,
        imgpath: 'jscript/themes/basic/images',
        toolbar: [true, "top"],
        onSelectRow: function(rowid) {
          if (rowid && rowid !== lastGroupRARowSelId) {
            jQuery('#RAGroupData').restoreRow(lastGroupRARowSelId);
            jQuery('#RAGroupData').editRow(rowid, true);
            lastGroupRARowSelId = rowid;
            if ($.inArray(rowid, rowLimitArray) == -1) {
              rowLimitArray.push(rowid);
            }
          }
        }
      });
      $("#t_RAGroupData").append("<input type='button' value='Submit Changes' style='background-color:#FFFFC0;height:20px;font-size:10px'/>");

       $("input", "#t_RAGroupData").click(function() {
            var ids = jQuery("#RAGroupData").getDataIDs();
     
            if (ids.length != 0) {
              for (var i = 0;i < ids.length;i++) {
                var data = $('#RAGroupData').getRowData(ids[i]);
     
                alert(data.MaxQuantity);
                alert(data['MaxQuantity']);
        }

}

});

However the data displayed is always "undefined" ? what am I doing wrong.

Many thanks

23/02/2009
09:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Try to see what you have in ids variable, that holds the id's of the grid. Simple use FireBug to see the values of all operations when click.

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:
46 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