Cloning usercontrol using Jquery
Page contains four grid with same no 开发者_如何学运维of columns.so, i have created a usercontrol which i am dragging four times on my page so it has created. uc1:grid1,uc1:grid2,uc1:grid3,uc1:grid4
.
This means after rendering it will fetch four grids from the server. So If i create a grid & using Jquery .clone() i.e $(grid).clone()
If i create 3 clones I can reduce server overhead. Is there any problem using this method?
If after cloning you need other data manipulation like changing headers and CSS and stuff like that, then sticking to your server code is more reasonable. But if you have 4 identical grids, int both structure and data, and they all have the same styles, then choose clone()
method.
精彩评论