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
Problem with key:true
16/11/2008
21:33
Avatar
Barry
Texas, USA
Member
Members
Forum Posts: 38
Member Since:
04/11/2008
sp_UserOfflineSmall Offline

I am working with a Grid with a Sub-Grid. I am doing in-line editing using the buttons in the first column. I'm using the code from the example to populate the buttons on the client. Here is a cut n paste of the code:

loadComplete: function(){
          var ids = jQuery("#grid1").getDataIDs();
            for(var i=0; i<ids.length; i++){
              var cl = ids[i];
                be = "<input style='height:22px;width:20px;' type='button' value='E' onclick=jQuery('#grid1').editRow("+cl+",true,pickdates); />";
                se = "<input style='height:22px;width:20px;' type='button' value='S' onclick=jQuery('#grid1').saveRow("+cl+",null,null,{'oper':'edit'}); />";
                ce = "<input style='height:22px;width:20px;' type='button' value='C' onclick=jQuery('#grid1').restoreRow("+cl+"); />";
        jQuery("#grid1").setRowData(ids[i],{act:be+se+ce})
            }
        }

What I am seeing is that when I set "key:true" in the colModel only the first row gets the buttons.

I added this alert inside the loop, alert(be+se+ce). I can see that a call is being made for each row. In fact the call is wrong. Instead of referencing the key column it references the column after the key column.

colNames:['Actions','Match ID','Squad ID','Season ID','Squad','Season','Date','Opponent','Site'],    
    colModel:[
        {name:'act',index:'act',width:70,sortable:false},
        {name:'match_id',index:'match_id',hidden:true,width:55,key:false,editable:true,editoptions:{readonly:true,size:10}},
                {name:'squad_id',index:'squad_id',hidden:true,width:55,key:false,editable:true,editoptions:{readonly:true,size:10}},
                {name:'season_id',index:'season_id',hidden:true,width:55,key:false,editable:true,editoptions:{readonly:true,size:10}},
        {name:'squad',index:'squad',width:90,editable:true,edittype:"select",editoptions:{<?=$squad_list?>}},
        {name:'season',index:'season',width:100,editable:true,edittype:"select",editoptions:{<?=$season_list?>}},
        {name:'date',index:'date', width:100, align:"right", editable:true,sorttype:"date"},    
        {name:'opponent',index:'opponent', width:150, align:"center", editable:true,editoptions:{size:50}},        
        {name:'site',index:'site', width:150,align:"center", editable:true,editoptions:{size:50}}    
    ],

Barry

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