带选择列表的 YUI Datatable 客户端过滤器?
我可以使用多个下拉菜单和分页的 YUI 数据表来过滤静态数据集的行吗?
Can I filter the rows of a static dataset using multiple drop-down menus and a paginated YUI datatable ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个 YAHOO.widget 组件,例如 YUI DataTable 使用 YUI 数据源< /a> 组件,它提供填充每个呈现的 YAHOO.widget 组件所需的数据。下面你可以看到它是如何工作的
注意每个 YAHOO.widget 组件内部通过 sendRequest 方法(参见步骤 1)。现在我们看一下sendRequest签名
它只是一个JavaScript对象可以描述如下(注意每个属性)
因此当每个YAHOO.widget组件通过sendRequest方法调用内部YUI数据源时,它会传递一个内置回调对象,如上所示 负责渲染 YAHOO.widget 组件本身。因此,如果您想要自定义行为,您需要调用底层 YUI 数据源并传递您的自定义回调对象来过滤 YUI 数据源提供的数据,如下所示
要将每个更改事件附加到每个选择,您可以使用
虽然未经测试,但我很确定它会正常工作。
Each YAHOO.widget component such as YUI DataTable uses a YUI DataSource component which provides data needed To populate each rendered YAHOO.widget component. Bellow you can see how it works
Notice each YAHOO.widget component internally makes a call To The underlying YUI datasource Through sendRequest method (See step 1). Now let's see sendRequest signature
It is just an JavaScript object which can be described as follows (Notice each property)
So when each YAHOO.widget component makes a call To The internally YUI datasource Through sendRequest method, It pass a built-in callback object as shown above which Takes care of rendering The YAHOO.widget component itself. So if you want a custom behavior, you need To make a call To The underlying YUI datasource and pass your custom callback object To filter The data provided by The YUI datasource as follows
To attach each change event To each select, you can use
Althoug not Tested, i am pretty sure it will work fine.