Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






loadComplete function

UserPost

17:16
27/10/2008


pat

Member

posts 9

This works …
loadComplete: function() {
    $.each(colNames2, function(i,k) { $("#"+ctab).setCell("0″, k, "", {'font-weight':'bold'}); });
}

But this …
loadComplete: setBold(ctab, colNames1)

function setBold(grd, nameArr) {
    $.each(nameArr, function(i,k) { $("#"+grd).setCell("0″, k, "", {'font-weight':'bold'}); });
};

fails because the $t.grid object doesn't exist in the setCell function. Is there a way to get this setBold function to work?

17:27
27/10/2008


digitalspaghetti

Member

posts 7

In your case, you need to do an anonymous function, like this:

loadComplete: function() {
    setBold(ctab, colNames1);
}

That should for you, however on the same function – my function is failing, and I don't know why:

'loadComplete': function() {
            var row_ids = jQuery("#campaigns-list").getDataIDs();
            jQuery.each(row_ids, function(i, row_id){
                var output = [];
                output.push('<a href="#" rel="'+row_id+'" class="campaign-button-edit">edit</a>');
                output.push('<a href="#" rel="'+row_id+'" class="campaign-button-delete">delete</a>');
                jQuery("#campaigns-list").setRowData(row_id, {
                    'actions':output.join('')
                    }
                );
            });

}


In my function I can see the row_id when i output it to firebug, however nothing appears in the column, except the column header – and I only get 5 columns back, when I should be getting 6 (the actions being missing).

Any ideas folks?

18:29
27/10/2008


digitalspaghetti

Member

posts 7

NM, I managed to fix it by passing a null value in the returned array of row values from PHP


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

215


Currently Online:

98 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 10277

Posts: 30375

Membership:

There are 11044 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1210

markw65 – 179

kobruleht – 144

phicarre – 132

YamilBracho – 124

Renso – 118

Administrators: admin (60 Posts)

Moderators: tony (7389 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information