Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript YAHOO.widget.RecordSet getRecord()基于属性值_Javascript_Yui_Extjs3_Yui2 - Fatal编程技术网

Javascript YAHOO.widget.RecordSet getRecord()基于属性值

Javascript YAHOO.widget.RecordSet getRecord()基于属性值,javascript,yui,extjs3,yui2,Javascript,Yui,Extjs3,Yui2,根据新项目的需要,从Ext3.x(高达v3.4)迁移到YUI 2.x(高达v2.9.0)javascript开发—YUI中的替代方案是什么,根据记录的给定属性值选择数据表中的某个记录(相当于EXT中的gridpanel)? 在EXT中,可以使用以下内容: new Ext.grid.GridPanel({...}).getStore( ).find(fieldName, value); 在YUI中,YAHOO.widget.DataTable类有一些自己的方法来检索记录实例(YAHOO.widg

根据新项目的需要,从Ext3.x(高达v3.4)迁移到YUI 2.x(高达v2.9.0)javascript开发—YUI中的替代方案是什么,根据记录的给定属性值选择数据表中的某个记录(相当于EXT中的gridpanel)? 在EXT中,可以使用以下内容:

new Ext.grid.GridPanel({...}).getStore( ).find(fieldName, value);

在YUI中,YAHOO.widget.DataTable类有一些自己的方法来检索记录实例(YAHOO.widget.Record):getRecord(),getRecordIndex()或检索整个记录集:getRecordSet()-YAHOO.widget.RecordSet类的实例-并使用此类的一些方法来获取记录(getRecord())但是这些方法都不能基于一个属性的值检索记录。我有点惊讶YUI没有这个基本功能(它应该是YAHOO.widget.RecordSet类级别的)。

恐怕没有这样的功能。您必须自己遍历记录集中的所有记录实例。在YUI的上一个2.9版本中,Record、RecordSet和ScrollingDataTable的API文档放错了位置,与DOM的API文档放错了位置,这使得查找有点困难,除非您只使用搜索框。

我已经这样做了,但我想也许我只是在重新发明轮子。谢谢你的回答,萨蒂扬!