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_Related Related Topics sp_TopicIcon
Grid Column and Cell width differences when using setRowData on gridComplete
14/04/2010
00:31
Avatar
syntaxritual
Fayetteville, AR
New Member
Members
Forum Posts: 1
Member Since:
13/04/2010
sp_UserOfflineSmall Offline

*********************

edit: Figured it out, in the code that isn't a sample im using some server side

stuff to determine whether nor not this col gets added, I had forgotten to add

an empty <cell> in the xml that is my grid data, to compensate for the additional

column in the grid.

*********************

Hey guys, 

I am trying to add a button into my grid that I am going to add a custom .click to…

I've got the button showing up, but the widths of my cells are now off a bit.

Below is basically what im doing.

Attached is a screenshot where you can see what I am talking about.

Anyone know what I may be doing wrong?

EDIT: It seems that the values in my "leano" column are being replaced by my "Approve" buttons…

          Is there an error in my usage of setRowData ?

          jQuery("#mygrid").jqGrid('setRowData',ids[i],{act:be});

You may need to view the image in a new window or tab to view it in its normal dimensions.

gridwoesImage Enlarger

jQuery(document).ready(function(){

    jQuery("#mygrid").jqGrid({

        url:'<?php $html->url('/controller/action/param'); ?>,

        mtype:'GET',

        datatype:'xml',

        caption:'This grid blah blah blah…',

        pager:'#pagered',

        sortname:'leanob',

        viewrecords:true,

        multiselect:false,

        autowidth: true,

        height:400,

        colNames:[

              'Action',

              ...

         ]

         colModel:[

              {name:'act',index:'act',width:60:sortable:false,editable:false},

              ...

          ]

          gridComplete: function(){

                  var ids = jQuery("#mygrid").jqGrid('getDataIDs');

                  for(var i = 0, i < ids.length; i++){

                      var cl = ids[i];

                      be = "<input style='height:22px:width:40px;' type='button' value='Approve' onclick="jQuery('#mygrid').editRow('"+cl+"');"  />";

                      jQuery("#mygrid").jqGrid('setRowData',ids[i],{act:be});

                  }

          }

    …

    });

});

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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