Is there any way to pass parameters to the column's "formatter" option function from MVC?
I need to use regional settings, so I can't use the built-in format option because it uses en-US settings only. So, I'm using the formatter option to format my fields with regional settings, but I'd like to be able to specify the number of decimal places allowed in my "toRegionalDecimalString" function, for example.
Hi Josh,I'm afraid that the formatter function is called by the igGrid with just one parameter, so even if you have a formatter function with 2, 3 or more input parameters, they will not be honored by the function call.(it doesn't matter if you configure the grid via JavaScript or via the MVC wrapper)So alternatively to a secondary input parameter, you can have a global JS variable which you can take into account in the body of the formatter function.However, the good news is we do ship regional settings alongside with localization settings for our jQuery controls :).The point is that these regional settings aren't well documented (a flaw which will be taken care of in the next volume release's documentation), but you can still use them.They're located in this folder: C:\Program Files (x86)\Infragistics\NetAdvantage 2012.1\jQuery\js\modules\i18n\regionalYou can pick your region of choice's JS file and add a reference to it in order to receive the regional settings described in it.The only trick is that you need to reference such a regional JS file after the reference to the infragistics.util.js file.I've attached an HTML sample page which demonstrates the Finnish regional settings being applied to the igGrid's column (in this case: a number and date columns).Let us know if you need any further assistance with "regionalizing" our jQuery controls. Cheers,Borislav
Hi Borislav,again on this topic: unfortunately column formatters only have one parameter, which is the current value of the cell. Is it possible, at least, to get informations about the current row and column? I was thinking at something similar to knockout's event parameters, "data" and "event".
I would like to render a numeric column as an image column, so I customized column options with a template and a formatter, as suggested here.I need to obtain an image source not only depending on the current value, but also depending on something like a custom matrix, which is different for each column: value1>imageA, value2>imageB, etc.
Could you please help me implementing such a feature on my igGrid?Thank you, Maria