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
help with editable Jqgrid in asp.net mvc
05/04/2010
18:16
Avatar
maitopoika
Member
Members
Forum Posts: 17
Member Since:
16/03/2010
sp_UserOfflineSmall Offline

I have this jqgrid, it shows the expected data. I only want the price to be editable, but when I click in the grid it doesn't change to edit mode as it should. Nothing happens infact.

can you help???

 <script type="text/javascript">
                  var themeURL = '<%=AppHelper.themeImageUrl() %>';
                  var gridUr = '<%=ResolveUrl("~/Order/JsonAccessories" )%>';
                  jQuery("#Accessorylist").jqGrid({
                      url: gridUr,
                      datatype: 'json',
                      mtype: 'GET',
                      colNames: ['PartUID', 'FieldDesc', 'price'],
                      colModel: [
                               { name: 'id', index: 'id', width: 100, align: 'left', editable: false, editrules: { edithidden: true }, hidden: true },
                               { name: 'FieldDesc', index: 'Description', width: 300, align: 'left', editable:false },
                               { name: 'price', index: 'Price', width: 200, align: 'left', editable: true }

                                ],
                     

                      pager: jQuery('#Accessorypager'),
                      rowNum: 10,
                      rowList: [5, 10, 20, 50],
                      sortname: 'Id',
                      sortorder: "desc",
                      viewrecords: true,
                      onSelectRow: function(id) {
                      if (id && id !== lastsel) {
                          jQuery('#Accessorylist').jqGrid('restoreRow', lastsel);
                          jQuery('#Accessorylist').jqGrid('editRow', id, true); lastsel = id;
                      }
                  },
                      imgpath: themeURL,
                      height: '250px'
                  });
                  jQuery("#Accessorylist").jqGrid('navGrid', "#Accessorylist", { edit: false, add: false, del: false });
              
            </script>

06/04/2010
19:05
Avatar
maitopoika
Member
Members
Forum Posts: 17
Member Since:
16/03/2010
sp_UserOfflineSmall Offline

No one has any ideas on this????

08/04/2010
13:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The first thing is to see if you have a correct id. Try this

....

    onSelectRow: function(id) {

         alert(id);
          if (id && id !== lastsel) {
                jQuery('#Accessorylist').jqGrid('restoreRow', lastsel);
                jQuery('#Accessorylist').jqGrid('editRow', id, true); lastsel = id;
          }
     },

....

Second I do not see any definition for lastsel.

it is a good idea to define such variable before cretion of the grid something like

var lastsel;

$("#mygrid").jqGrid({...})

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