i need to place defalut text to all rows for perticular column in jquery grid?
can anybody help me out..
thanks
i need to place defalut text to all rows for perticular column in jquery grid?
can anybody help me out..
thanks
Apply a class name to the cells that require a default text -in this example the class name is 'placeholder'- and target that with jQuery:
$(document).ready(
function() {
$('td.placeholder').text('this message to be shown');
}
)
It's untested, but I think it'll do what you want, unless you need to use specific html for some reason? In which case:
$('td.placeholder').html('<span class="default_text">this message to be shown</span>');
should work instead.
if I need to perform only for one last cell? thanks – kumar
If you only need to perform this action on one particular cell you can either assign an id or a class to that cell, an id is/must be/should be unique in the document so only one element can have any id. A class is probably still the easiest solution, since it allows for later re-use of the same code/jQuery function. Still, to advise:
// to select <td> element of a particular id:
$('td#element_id').text('this message to be shown');
// to select the last cell:
$('td:last').text('this message to be shown');
// to select only the last cell that has a particular class-name 'placeholder':
$('td.placeholder:last').text('this message to be shown');
Incidentally, you might like to read the jQuery docs, over at: docs.jquery.com/