그리드 클래스와 관련된 extjs 저장소가 있습니다. 클래스를 선택하면 레코드의 ClassID를 제공합니다.
var ClassData = record.get('ClassID');
console.log(ClassData);
이 ClassID를 기반으로 다음 그리드의 저장소를로드하고 있습니다.
var Grid = this.getSemGrid();
var Store = Grid.getStore(); // your grid's store
//load store with records having selected class ID
var g = Store.load( {params : {ClassID: ClassData }});
여기까지 모든 것이 괜찮습니다.
스토어가로드되면로드 된 모든 레코드를 가져옵니다 ( 오류 영역 ).
var selected = g.getRange(); // getRange = select all records
그런 다음 배열에있는 모든 레코드의 한 필드에있는 모든 값을 푸시합니다.
var Excerpt = []; // start with empty array
Ext.each(selected, function(item) {
// add the fields that you want to include
var Obj = {
third_field: item.get('ExamName')
};
Excerpt.push(Obj); // push this to the array
}, this);
console.log(Excerpt);
Excerpt는 현재 레코드가 아닌 이전에 선택한 레코드의 배열을 제공합니다.
나는 또한 시도했다
Store.loadData([],false);
다시로드하기 전에 저장소의로드 된 모든 데이터를 지우십시오.
이 작동
var g = Store.load({
params : {ClassID: ClassData },
callback : function(records, operation, success){
var Excerpt = []; // start with empty array
Ext.each(records, function(item) {
// add the fields that you want to include
var Obj = {
third_field: item.get('ExamName')
};
Excerpt.push(Obj); // push this to the array
}, this);
}
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다