① extjs中如何選中grid中的行,並設置該行不可編輯

Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
listeners:{
beforeedit:function(editor, e, eOpts){
//return false;//不可編輯
return true;//可編輯
}
},
height: 200,
width: 400,
renderTo: Ext.getBody()
});
② extjs 在grid編輯控制項上 點一個單元格修改後 怎樣及時保存到資料庫
手頭沒有代碼,兄弟,我曾靜做過,給你個思路
ext例子有個編輯單元格的例子,你先看那版個,當你編輯權完,應點擊保存,再保存到資料庫中,具體是點保存的時候加上一個函數,在函數中,拿到修改的東東,ajax請求後台,把你修改的值拼成json串傳到後台,在後台將之轉換成對象屬性並進行資料庫更新 ,當然也可以拼成一個數組,傳到後台 ,看你喜好了。
③ extjs 如何實現在表格編輯狀態下輸入數字後,按回車自動到下一行的編輯狀態
你在GRID裡面加一個KEYS   監聽回車。 
然後在監聽方法裡面獲取當前編輯的CELL  然後得到當前編輯的CELL下一列的CELL。 然後調用開始編輯方法。
具體的用法可以看看editgridpanel的api 找到keys這個屬性 看看說明
④ extjs4.0 grid 行編輯 之後保存失敗
var records = storeERP.getUpdatedRecords();//這句可以獲取所有改變的值
alert(records);
Ext.Array.each(records, function(model) {
itemID = Ext.decode(model.data.BB002);
arr.push(itemID);
comID = Ext.JSON.encode(model.data.MW002);
alert(comID);
array.push(comID);
});
然後,全部提交,也就是一次性提交就好了,
 
你這樣試試看,一次性提交
⑤ Extjs 4.x 為GridPanel動態添加一行數據
//聲明對應grid的Record對象 
var ItemRecord = Ext.data.Record.create([
        {name:'itemid'},
        {name:'itemcode'},
        {name:'itemname'},
        {name:'price'},
        {name:'mark'}
    ]);            
 //點新增按鈕時則執行類似如下函數
function addNewLine2Grid(grid){
        var rec = new ItemRecord({  //實例化Record對象,並賦予各欄位初始值
            'itemid': 0,
            'itemcode': '',
            'itemname': '',
            'price': 0.00,
            'mark': ''
        });
        grid.store.insert(grid.store.getCount(), rec);  //插入新行作為grid最後一行
        grid.getView().refresh(); //刷新
        //grid.plugins[1].startEditing(grid.store.getCount()-1,4); //編輯最後一行第4列 
    }
⑥ Extjs的Ext.grid.GridPanel組件進行行編輯或單元格編輯之後如何將修改之後的數據及時的更新到資料庫
Ext.grid.plugin.CellEditing
Ext.grid.plugin.RowEditing
你用的應該是以上兩種
你可以用canceledit事件做提交後台,總是方式回很多
然後答grid.getStore().reload();刷新
⑦ 使用extjs ,直接在grid上編輯後,如何將整個修改的數據行 傳到後台並解析成datatable
呃 這個很簡單啊 grid修改編輯後 其實它自己已經記錄了你所修改的數據
你只需要獲取並訪問後台就行了
editor.on({
	scope: this,
	afteredit: function(roweditor, changes, record, rowIndex) {
		Ext.Ajax.request({
			url   : localhostURL + '/Ad.do',
			method: 'POST',
			jsonData :Ext.util.JSON.encode(record.data),
			// record.phantom 是否為更新數據 ? true : false
			params: {action:'saveOrUpdate'},
			success: function(response) {
				if(response.responseText == 'succ'){
					Ext.example.msg('Message','Operation success!');
				}else{
					Ext.example.msg('Message','Operation failed!');
				}
				reloadAdStore();
			}
		});
	}
});
你看 很簡單 就這樣就可以了
⑧ ExtJs實現刷新Grid單個單元格
首先你要找到你要修改的那行記錄,然後再修改那行記錄中某個指定欄位 值。
代碼:
//獲取內grid表格的store
var store = grid.getStore();
//尋找行容記錄
var index = store.find("fieldName","value");
if(index == -1){
        return;
}
var record = store.getAt(index);
//修改值
record.set("要更新的列","要更新的目標值");
以上執行完了,你就可以看到你的表格裡面你指定的那行記錄的那個單元格的值變成你要修改的了。
⑨ 關於extjs的,在修改grid中的數據時,如何把要修改的數據復制到新打開的修改窗口中
先建立一個新窗口,如果已經新建好,則新建一個from,將form的randerTo設置為新窗口的內對應容的容器,然後監聽grid的rowselect事件,在事件中即可以復制數據到新窗口的form中,像這樣:
rowselect: function(sm, row, rec) {
  Ext.getCmp("company-form").getForm().loadRecord(rec);
}
如果要修改,估計還要添加一個form的提交按鈕,並作相應的點擊事件處理