ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: stoodin on May 19, 2014, 07:19:24 pm
-
Hi Paramvir,
I have a grid on one page that depends on condition I have to repeat a few times.
Is there any easy way to show a grid with same name multiple times without copying the js file and rename the grid?
Thanks a lot,
-
Do you mean by HTML name attribute or variable name of the grid instance i.e., $grid ?
you could deep clone the initialization object i.e., the object passed to pqGrid constructor and create as many grid instances as required with it.
-
Oh Great Idea,
I just need to show the same grid multiple times on the same html page with more efficient way as possible.
There is some data repetition and depends on situation we ask user to enter the same data multiple times.
Any chance you can give me a small example of deep clone of grid init object and how do I use it on the page?
Thanks a lot
-
Please see the line 58 in this demo http://paramquery.com/pro/demos/nesting
var objCopy = $.extend(true, {}, gridDetailModel);
which deep clones the constructor object of the detail grid instances. $.extend is part of jQuery API
-
Great,
Thanks a lot. I did it and it works.