NotesViewEntry 排序项目
NotesViewEntry sort items
我在数据 table 的数据绑定中有以下代码。我想对零件 (spareProductPart) 上的项目 (viewEntries) 进行排序,以便显示它们在我的数据中排序 table。
var thisDb:NotesDatabase = sessionAsSigner.getDatabase("","demo/demo.nsf");
Ventry=function(ve:NotesViewEntry){
this.prod=entry.getDocument().getItemValueString("spareProduct");
this.drawing=entry.getDocument().getItemValueString("spareDrawingNumber");
this.part=entry.getDocument().getItemValueString("spareProductPart");
this.unid=entry.getUniversalID();
etc ....
}
var viewEntries=[];
var Collection:NotesViewEntryCollection=thisDb.getView("parts").getAllEntries();
Collection.FTSearch(viewScope.toSearch);
var entry:NotesViewEntry=Collection.getFirstEntry();
while (entry!=null){ //loop over all entryes
viewEntries.push( new Ventry( entry) )
entry = Collection.getNextEntry();
}
return (viewEntries);
"This class provides you mainly with a collection of documents in a view-sorted order." 这意味着如果您希望您的 viewEntryCollection 按部件号排序,则您的视图必须以这种方式排序。所以答案:更改视图,使其按 spareProductPart
排序
使用 NotesView 的 FTSearchSorted 而不是 FTSearch。
您的代码将如下所示:
...
var viewEntries = [];
var viewParts:NotesView = thisDb.getView("parts");
viewParts.FTSearchSorted(viewScope.toSearch, 0, "yourSortedColumnName");
var Collection:NotesViewEntryCollection = viewParts.getAllEntries();
var entry:NotesViewEntry = Collection.getFirstEntry();
...
我在数据 table 的数据绑定中有以下代码。我想对零件 (spareProductPart) 上的项目 (viewEntries) 进行排序,以便显示它们在我的数据中排序 table。
var thisDb:NotesDatabase = sessionAsSigner.getDatabase("","demo/demo.nsf");
Ventry=function(ve:NotesViewEntry){
this.prod=entry.getDocument().getItemValueString("spareProduct");
this.drawing=entry.getDocument().getItemValueString("spareDrawingNumber");
this.part=entry.getDocument().getItemValueString("spareProductPart");
this.unid=entry.getUniversalID();
etc ....
}
var viewEntries=[];
var Collection:NotesViewEntryCollection=thisDb.getView("parts").getAllEntries();
Collection.FTSearch(viewScope.toSearch);
var entry:NotesViewEntry=Collection.getFirstEntry();
while (entry!=null){ //loop over all entryes
viewEntries.push( new Ventry( entry) )
entry = Collection.getNextEntry();
}
return (viewEntries);
"This class provides you mainly with a collection of documents in a view-sorted order." 这意味着如果您希望您的 viewEntryCollection 按部件号排序,则您的视图必须以这种方式排序。所以答案:更改视图,使其按 spareProductPart
排序使用 NotesView 的 FTSearchSorted 而不是 FTSearch。
您的代码将如下所示:
...
var viewEntries = [];
var viewParts:NotesView = thisDb.getView("parts");
viewParts.FTSearchSorted(viewScope.toSearch, 0, "yourSortedColumnName");
var Collection:NotesViewEntryCollection = viewParts.getAllEntries();
var entry:NotesViewEntry = Collection.getFirstEntry();
...