如何通过 JavaScript/Ajax 代码管理 Infragistics WebGrid 数据?
我正在开发一个项目,需要对某些数据列表使用 Infragistics WebGrid 控件。 我使用 JavaScript 在客户端加载数据以在地图上显示,然后我需要在多个 WebGrid 中显示相同的数据。 所有可用的数据都将显示在 WebGrid 中,但在任何给定时间,只有数据的子集(仅当前在视图中的数据)将绘制在地图上。 由于我使用 JavaScript/Ajax 加载数据,因此我只想加载一次,并使用相同的机制用数据填充 WebGrid 控件。
是否有人对完全从客户端 JavaScript/Ajax 代码中使用 WebGrid 有任何提示/指示?
I am working on a project that I need to use the Infragistics WebGrid control for some lists of data. I am loading the data on the client-side using JavaScript for display on a Map, and then I need to display that same data within multiple WebGrids. All the data available will be displayed in the WebGrids, but only a subset of the data (only that which is currently within view) will be plotted on the Map at any given time. Since I am loading the data using JavaScript/Ajax, I would like to only load it once, and use the same mechanism to populate the WebGrid control with data too.
Does anyone have any tips/pointers on working with the WebGrid completely from within client-side JavaScript/Ajax code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Infragistics webgrids 公开了一个非常复杂的客户端对象模型,您将能够使用它来填充数据客户端。
您要做的第一件事是查看 webgrid 控件的完整 CSOM,您可以在以下位置找到当前的文档版本: http://help.infragistics.com/NetAdvantage/NET/2008.3/CLR2.0/
要制作一个简短的示例,您需要获取一个参考到您的网格,然后添加一些行和数据。 在设计时为网格设置列定义可能会更容易,而不是尝试在 JavaScript 中完成这一切。
首先:获取网格的引用:
然后添加一个新行:
完成后,您可以循环行的列来填充数据:
或通过键寻址每个列以填充其数据:
The Infragistics webgrids expose a very complex client side object model that you will be able to use to populate your data client side.
The first thing you will want to do is get a look at the full CSOM for the webgrid control, you can find the current doc version at: http://help.infragistics.com/NetAdvantage/NET/2008.3/CLR2.0/
To make a short example, you will need to grab a refence to your grid(s) and then add some rows and data. It would probably be easier to setup the column definitions for your grids at design time, rather than try to do it all in the javascript.
First: get a refrence to your grid:
Then add a new row:
After thats done you can loop the columns of your row to fill the data:
or address each one by key to populate its data:
我想到的唯一想法是与性能相关。 我们发现为 UltraWebGrid 动态创建和填充行比我们希望的要慢得多。 (在我们的例子中,我们将行从一个网格移动到另一个网格,当行数太大时会遇到性能问题。)
如果我正在做像您今天描述的那样的事情,如果可能的话,我会从服务器端填充网格,然后在地图上显示相关值。
作为附加免责声明,我们使用了 Infragistics 2007.1; 我不知道2008.x在这方面是否更好。
The only thought that comes to mind is performance-related. We found that dynamically creating and populating rows for an UltraWebGrid was appreciably slower than we would have liked. (In our case we were moving rows from one grid to another and hit performance issues when the number of rows was too great.)
If I was doing something like you describe today, I would populate the grid from the server side if at all possible, and the display the relevant values on the Map from there.
As an added disclaimer, we used Infragistics 2007.1; I do not know if 2008.x is better in this area.