很难找到 DataGrid 来实现超过 10,000 条记录,并为每行提供分页、过滤和可单击链接
我尝试过使用几种不同的数据网格(FlexiGrid、ExtJs Grid 和 YUI DataGrid),并发现就可用的文档和功能而言,YUI 的工作效果最好。但是,我在设置数据源时遇到困难。当我尝试使用 JSON 进行设置时,它花费的时间太长,或者超时。我已经最大化了 php.ini 文件中的内存使用量。未来还会有更多记录。
我需要根据当前登录的用户选择数据来填充网格。一旦此信息填充网格,我需要每个 id 可单击并将我带到不同的页面,或者在 div 中填充信息同一页面。
有人对一次加载 25 – 50 条动态数据有建议吗?我尝试实现以下示例来执行我想要的操作: YUI 开发人员示例 我根本无法显示数据网格。我已将数据实例更改为以下内容。
<代码> // 数据源实例
var curDealerNumber = YAHOO.util.Dom.getElementsByClassName('dealer_number', 'input');
var ds_path = + "lib/php/json_proxy.php?dealernumber='" + curDealerNumber + "'";
var myDataSource = new YAHOO.util.DataSource("ds_path");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
结果列表:“记录”,
字段:[
{键:“id”,解析器:“number”},
{key:"user_dealername"},
{key:"user_dealeraccttype"},
{键:“workorder_num”,解析器:“number”},
{键:“segment_num”,解析器:“number”},
{键:“状态”},
{key:"claim_type"},
{key:"created_at"},
{key:"updated_at"}
], 元字段:{
TotalRecords: "totalRecords" // 访问服务器响应中的值
} }; 非常感谢任何帮助
,如果这看起来与其他帖子类似,我们很抱歉,但我搜索后仍然无法解决我的问题。谢谢你!
I have tried using a few different data grids (FlexiGrid, ExtJs Grid, and YUI DataGrid) and have found YUI to work the best as far as documentation and features available. However, I am having difficulty setting up the data source. When I try to set it up using JSON, it takes too long, or times out. I have already maxed out the memory usage in the php.ini file. There will be many more records in the future as well.
I need to select data to populate the grid based on the user that is currently logged in. Once this information populates the grid, I need each id to be click-able and take me to a different page, or populate information in a div on the same page.
Does anyone have suggestions on loading 25 – 50 records at a time of dynamic data? I have tried implementing the following example to do what I want: YUI Developer Example
I cannot get the data grid to show at all. I have changed the data instance to the following.
// DataSource instance
var curDealerNumber = YAHOO.util.Dom.getElementsByClassName('dealer_number', 'input');
var ds_path = + "lib/php/json_proxy.php?dealernumber='" + curDealerNumber + "'";
var myDataSource = new YAHOO.util.DataSource("ds_path");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema = {
resultsList: "records",
fields: [
{key:"id", parser:"number"},
{key:"user_dealername"},
{key:"user_dealeraccttype"},
{key:"workorder_num", parser:"number"},
{key:"segment_num", parser:"number"},
{key:"status"},
{key:"claim_type"},
{key:"created_at"},
{key:"updated_at"}
],
metaFields: {
totalRecords: "totalRecords" // Access to value in the server response
}
};
Any help is greatly appreciated, and sorry if this seems similar to other posts, but I searched and still could not resolve my problem. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有重现案例,很难排除故障,但我建议打开日志记录以查看问题可能出在哪里:
还要确保使用 Firebug 或类似工具的 XHR 请求和响应格式良好。
最后,在处理大型数据集时,请考虑
没有适合所有人的一刀切的解决方案,但希望您能够找到适合您的用例的一组调整。
It's hard to troubleshoot without a repro case, but I'd suggest turning on logging to see where the problem might be:
Also make sure the XHR request and response are well-formed with Firebug or similar tool.
Finally, when working with large datasets, consider
There is no one-size-fits-all solution for everyone, but hopefully you can find the right set of tweaks for your use case.