Ext 通過條件隱藏指定的行

/**
 * 按查詢參數查詢
 */
var removedRecords = null;
var selectSgin = 0;
function doSearch(arSoftwareRequireGrid, arSoftwareRequireStore) {
	var dateStart = Ext.getCmp('dateStart').getValue(); //開始日期
	var dateEnd = Ext.getCmp('dateEnd').getValue(); //結束日期
	if (!dateStart && !dateEnd) {
		if (selectSgin == 1) { // 說明來查詢了一次
			if (removedRecords != null) {
				Ext.each(removedRecords,
				function(record) { // 還原隱藏的行
					arSoftwareRequireStore.insert(0, record); // 插入到第一行
				});
				removedRecords = null;
				return;
			}
		} else {
			alert('請填寫查詢條件!');
		}
		selectSgin = 0;
		return;
	}
	if (dateStart && dateEnd) {
		if (dateEnd < dateStart) {
			alert('結束日期不能小於開始日期,請重新選擇日期範圍!');
			return;
		}
	}
	selectSgin = 1;

	arSoftwareRequireStore.each(function(record, index) { //get的名字要與Store綁定的Model的名字是一樣的
		//	     var info = record.get('rdPlanTime');  // 獲取指定的參數 
		// 通過條件判斷,是否需要選中
		if (record.get('caProgress') < 100) {
			arSoftwareRequireGrid.getSelectionModel().select(record, true);
		}
	});
	var tem = arSoftwareRequireGrid.getSelectionModel().getSelection(); // 獲取選中的
	if (!tem || tem == '') {
		//Ext.Msg.alert('提示','未選擇任何列,請選擇要刪除的數據!');
		return;
	} else {
		var sm = arSoftwareRequireGrid.getSelectionModel(); // 獲取選中的行
		removedRecords = sm .getSelection(); // 獲取選中的
		arSoftwareRequireStore.remove(sm.getSelection());
		//	removedRecords = arSoftwareRequireStore.getRemovedRecords();// 獲取刪除的
	}


}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章