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 please with ediing a JqGrid
12/04/2010
20:42
Avatar
maitopoika
Member
Members
Forum Posts: 17
Member Since:
16/03/2010
sp_UserOfflineSmall Offline

I really need to get this working but I am out of Ideas as to what is wrong with it.

Here is my jqgrid

 <script type="text/javascript">
                    var spainvid = $("#hiddenspainvid").val();
                    var lastsel;
                    var themeURL = '<%=AppHelper.themeImageUrl() %>';
                    var gridUr = '<%=ResolveUrl("~/SpaOrder/JsonAccessories")%>';
                    jQuery("#Accessorylist").jqGrid({
                        url: gridUr + '/' + spainvid,
                        datatype: 'json',
                        mtype: 'GET',
                        colNames: ['SpaPartUID', 'FieldDesc', 'price'],
                        colModel: [

                               { name: 'SpaPartUID', index: 'SpaPartUID', width: 100, align: 'left', editable: false, editrules: { edithidden: true }},
                               { name: 'FieldDesc', index: 'Description', width: 200, align: 'left', editable: false },
                               { name: 'price', index: 'Price', width: 200, align: 'left', editable: true, edittype: 'text', editoptions: { size: 20, maxlength: 30} }

                                ],

                        editurl:'<%=ResolveUrl("~/SpaOrder/JsonAccessories")%>',
                        pager: jQuery('#Accessorypager'),
                        rowNum: 10,
                        rowList: [5, 10, 20, 50],
                        sortname: 'id',
                        sortorder: "asc",
                        viewrecords: true,
                        onSelectRow: function(id) {
                            if (id && id !== lastsel) {
                                jQuery('#Accessorylist').restoreRow(lastsel);
                                jQuery('#Accessorylist').editRow(id, true);
                                lastsel = id;
                            }
                        },
                        imgpath: themeURL,
                        height: '250px'
                    });
                </script>

I want to allow the price field to be editable. but when you cliick on the price field nothing happens, it just selects the row, and does not enter the edit mode.

please help if you can, what Am i missing?

13/04/2010
06:52
Avatar
Preichow
Member
Members
Forum Posts: 13
Member Since:
24/03/2010
sp_UserOfflineSmall Offline

I have a working grid with inline editing, using almost the exact same code as you.   The major difference I notice between our code is the onSelectRow function, I have a couple more settings in my editRow line:

onSelectRow: function(id){
    if(id && id!==lastSelectedId){
      jQuery('#list').restoreRow(lastSelectedId);
      jQuery('#list').editRow(id,true,null,onSaveSuccess);
      lastSelectedId=id;
    }

Also in your code, unrelated to editing: I note that you have 'id' as a sortname.  I believe you'll have to change that to one of your colModel column names to sort?  I also see that "SpaPartUID" is set to editable:false, but then there are some edit rules listed.  Maybe remove those?

If those changes fail to fix the problem, let me know and I'll post the full jrQrid page code.

PS: what command did you use to post your code? in most forums, it's [code] but that didn't work for me.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
55 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