سؤال

How do I get the formatted value of one column in another column in jqgrid.

For eg:

{ name: 'amount', index: 'amount', sorttype: "float", formatter: processAmount, title: false },
{ name: 'netAmount', index: 'netAmount', sorttype: "float", formatter: function (cellvalue, options, rowObject) 
{
     // How do I get the formatted value of column "amount" here?
} 
}

I know that I am posting very little of my requirement or code. But I hope this is sufficient. Please let me know if you need more information on anything.

Thanks, Sam

هل كانت مفيدة؟

المحلول

Custom formatters will be called before the body of the grid will be placed on the page. So you can't access the formatted value of one column inside of custom formatter of another column. What you can still do is calling of another formatfer. For example you can call processAmount function inside of formatter of netAmount column.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top