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
Subgrid row highlighting doesn't reset after selecting another row
20/01/2010
01:51
Avatar
msshushu
Member
Members
Forum Posts: 15
Member Since:
13/01/2010
sp_UserOfflineSmall Offline

Hi,

I have a master grid with sub grids. the highlighting in the master grid works normally. However, in my sub grid when i select a row it highlights, when i select another row, it highlights the new row but doesn't remove the highlight from the previous row. so if i click on all rows, i end up with a sub grid that's fully highlighted. is this a bug? I am using IE 8 and firefox.

$("#contractors").jqGrid({

        url:'contractor_data.aspx?call=' + $("#<%= lblContractorCompany.ClientID %>").text(),

        datatype: 'json',

        mtype: 'GET',

        colNames:['ID','Full Name'],

        colModel:[

            {name:'ID',index:'ID', width:100,hidden:true},

            {name:'FullName',index:'FullName', width:55}            

        ],

        pager: "#contractorsPager",

        rowNum:-1,

        autowidth:true,

        height:"100%",

        sortname: 'ID',

        sortorder: "desc",

        viewrecords: true,

        caption: 'Contractors',

        subGrid: true,

        subGridRowExpanded: function(subgrid_id, row_id) {

            var listUrl = "";

            // we pass two parameters

            // subgrid_id is a id of the div tag created within a table

            // the row_id is the id of the row

            // If we want to pass additional parameters to the url we can use

            // the method getRowData(row_id) - which returns associative array in type name-value

            // here we can easy construct the following

            var subgrid_table_id, pager_id;

            subgrid_table_id = subgrid_id+"_t";

            pager_id = "p_"+subgrid_table_id;

            $("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");

            $("#"+subgrid_table_id).jqGrid({

              url:"contractor_data.aspx?sub=true&fullname="+$("#contractors").getRowData(row_id).FullName + "&complete=" + $("#cbComplete").attr("checked") + "&verified=" + $("#cbVerified").attr("checked"),

              datatype: "json",

              colNames: ['ID','Customer','Full Name','Start Time','End Time','Project Name','Job Category','Actual Hours Worked', 'Labor Cost','Project Expense','Complete','Verified by Manager'],

              colModel: [

                {name:"ID",index:"ID",hidden:true,key:true},

                {name:"Customer",index:"Customer",width:250},

                {name:"FullName",index:"FullName",width:150},

                {name:"StartTime",index:"StartTime",width:100},           

                {name:"EndTime",index:"EndTime",width:100},

                {name:"ProjectName",index:"ProjectName",width:400},

                {name:"JobCategory",index:"JobCategory",width:150},

                {name:"ActualHoursWorked",index:"ActualHoursWorked",width:150,editable:true},

                {name:"LaborCost",index:"LaborCost",width:150,editable:true},

                {name:"ProjectExpense",index:"ProjectExpense",width:150,editable:true},

                {name:"Complete",index:"Complete",width:100,editable:true,edittype:"checkbox",editoptions: {value:"Yes:No"}},

                {name:"VerifiedByManager",index:"VerifiedByManager",width:150,editable:true,edittype:"checkbox",editoptions: {value:"Yes:No"},hidden:true}

              ],

              rowNum:-1,

              pager: pager_id,

              height: "100%",

              autowidth:true,

              viewrecords: true,

              onSelectRow: function(id){

       if(id && id!==lastsel){

       $("#"+subgrid_table_id).jqGrid('restoreRow',lastsel);

       $("#"+subgrid_table_id).jqGrid('editRow',id,true);

       lastsel=id;

       }

         },

         editurl:"contractor_data.aspx",

              sortname: 'ID',

              sortorder: "desc"

            });

            $("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:false})

        }

    });

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

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

Hello,

I think that this is not a bug. Please verify that your subgrid have uniquie row ids.

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