Title: Datagrid options get values from object Post by: Wojak on February 07, 2023, 01:44:19 PM Hi,
How to get all values from options of columns exactly formatter or other that has function inside Title: Re: Datagrid options get values from object Post by: jarry on February 07, 2023, 07:08:08 PM Please call this code.
Code: var dg = $('#dg'); Title: Re: Datagrid options get values from object Post by: Wojak on February 08, 2023, 02:33:08 PM Thanks for your answer, but I think I misunderstood the question. I would like to get the code from "formatter" like below because I can't find it in that form.
Code: formatter: function (value, row, index) { Title: Re: Datagrid options get values from object Post by: Wojak on February 08, 2023, 03:13:15 PM Ok I found a plugin to JS for JSON https://github.com/vkiryukhin/jsonfn (https://github.com/vkiryukhin/jsonfn) that shows the function inside
Title: Re: Datagrid options get values from object Post by: Wojak on February 08, 2023, 04:13:53 PM Oh also i found out how to make function from database saved in JSON to run.
Code: columns.forEach(col=>{if(col.formatter){col.formatter=JSONfn.parse(JSONfn.stringify(col.formatter));}}); |