導航:首頁 > 編程語言 > extjsgrid刪除行

extjsgrid刪除行

發布時間:2022-09-18 07:24:04

1. extjs4 中var SubGrid = Ext.create('Ext.grid.Panel', 可以刪除選中這條記錄中某個單元格的數據么

刪單元格?還是Record?不過都要先獲取當前Record。
如果是單元格的話就是修改record的data對象的屬性,像data.FieldName=null;

2. Extjs grid 用CheckboxSelectionModel如何刪除多行

CheckboxSelectionModel是grid的選擇模式
刪除行應該使用grid的store.remove方法。

3. extjs monthfield如何清空

可以去CSDN社區,有很多大神,會得到滿意的答復
摘自CSDN社區
{text: '刪除' ,width:60,handler:function (){

gridForm.getForm().submit({

url : 'bookinput.do?actionsign=del',
method : 'post',
params:{inss:Ext.get('inss_name').dom.value.substring(0,1),inssname:Ext.get('inss_name').dom.value.substring(2,20), state:Ext.get('state_name').dom.value.substring(0,1),bookname:Ext.get('bookname').dom.value,author:Ext.get('author').dom.value,rate:Ext.get('rate').dom.value,pbsco:Ext.get('pbsco').dom.value},

waitMsg:'正在刪除...',

success : function(gridForm,action) {
if(action.result.success)
{
mydslist.load();
Ext.Msg.alert('提示信息',action.result.msg);

}
else{
Ext.Msg.alert('提示信息',action.result.msg);

}

},
failure : function(gridForm,action) {
Ext.Msg.alert('提示信息',action.result.msg);
}
});
Ext.getCmp("inss_name").setValue('');
Ext.getCmp("state_name").setValue('');
Ext.getCmp("bookname").setValue('');
Ext.getCmp("author").setValue('');
Ext.getCmp("pbsco").setValue('');
Ext.getCmp("rate").setValue('');
(3)extjsgrid刪除行擴展閱讀:
extjs是一種軟體。自動生成行號,支持checkbox全選,動態選擇顯示哪些列,支持本地以及遠程分頁,可以對單元格按照自己的想法進行渲染,這些也算可以想到的功能。
單選行,多選行,高亮顯示選中的行,拖拽改變列寬度,按列排序,這些基本功能ExtJS輕量級實現。
自動生成行號,支持checkbox全選,動態選擇顯示哪些列,支持本地以及遠程分頁,可以對單元格按照自己的想法進行渲染,這些也算可以想到的功能。
再加上可編輯grid,添加新行,刪除一或多行,提示多行數據,拖拽改變grid大小,grid之間拖拽一或多行,甚至可以在tree和grid之間進行拖拽,這些功能實在太神奇了。更令人驚嘆的是,這些功能竟然都在ext表格控制項里實現了。
其實從ext3開始就支持各種方式的統計,且有控制項支持excel導出。

4. 求助,extjs表格中最後的那列怎麼去掉啊,效果在下面,求高手指點!!!!!

我覺得這不是最後一列。。。只是說你所有的列就只有這么寬了,所以後面留白了
你可以在其中一列中定義如下屬性
columns: [{
text: '列名',
flex: 1,
dataIndex: 'xxx'
}]
用flex來填充寬,就不會留白了
其中
flex也可以是小數,即 flex: 0.5
所有列的flex相加最好為1,即其寬的百分比

5. extjs grid 處理當前行不取消其他選擇行…………如編輯當前行……其他選擇行不被取消如何

編輯模式無法選擇多行,如果沒有編輯模式倒是可以。


selModel:{
selType:'rowmodel',
mode:'MULTI'
}

官網說明:

"MULTI"- Allows complex selection of multiple items using Ctrl and Shift keys.

允許復雜的多項選擇,使用Ctrl 或Shift 建。

6. extjs 里怎麼讓grid 取消選中某行

Ext.selection.Model.deselect(records)

用在grid中可以用:
grid.getSelectionModel().deselect(records);
其中參數 records , 可以是想取消選中的記錄的數組 , 也可以是想取消選中的記錄的 排序數

可以查看API

7. 請問EXTJS4中怎麼在一個GridPanel中的每一行的最後加入兩個按鈕比如是刪除和查看

參考幫助文檔:actioncolumn


Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['firstname', 'lastname', 'senority', 'dep', 'hired'],
data:[
{firstname:"Michael", lastname:"Scott"},
{firstname:"Dwight", lastname:"Schrute"},
{firstname:"Jim", lastname:"Halpert"},
{firstname:"Kevin", lastname:"Malone"},
{firstname:"Angela", lastname:"Martin"}
]
});
Ext.create('Ext.grid.Panel', {
title: 'Action Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex:'firstname'},
{text: 'Last Name', dataIndex:'lastname'},
{
xtype:'actioncolumn',
width:50,
items: [{
icon: 'extjs/examples/shared/icons/fam/cog_edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('firstname'));
}
},{
icon: 'extjs/examples/restful/images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname'));
}
}]
}
],
width: 250,
renderTo: Ext.getBody()
});

8. Extjs grid 用CheckboxSelectionModel如何刪除多行

首先要支持多選
CheckboxSelectionModel.getSelections() 將獲得一個record的數組, 將數組中的record元素解析成你想要的格式 傳向後台 進行循環刪除.

9. extjs gridpanel問題

修改:grid定義成EditorGridPanel,然後在cm的數組定義每一列時,對要編輯的加上editor;
例如,var cm= [{
header:"溫度",
dataIndex:"temperature",
width:100,
editor : new Ext.form.TextField({
id:"temperature"
})
}]
就可以編輯修改了。

刪除:如果只單說前台,就是對store的record的操作了,例如store.remove(record)去查api里都有。如果是配合後台,那麼在後台刪除之後要麼從新reload,要麼直接前台store.remove

動態加列:往你的record的Fields數組和columnmodel的cm數組里push新的對象,
如cm.push({
header : "新的",
width : 120,
dataIndex : "inUse",
align : "center"
});
fields.push({
name : "inUse",
type : "string",
mapping : "inUse"
});
然後sotre重新new一下
如store = new Ext.data.JsonStore({
fields : fields
});
最後把cm重新加一次
grid.reconfigure(store , new Ext.grid.ColumnModel(cm));

10. extjs 怎樣創建一個空表格,默認有10個空行,實現增加行和刪除行急!

ExtJS 分頁數據表文章分類:Web前端ir - DESC 排序方式 ASC為升序limit -25 記錄數sort-lastpost 排序欄位start -0 開始記錄 $data[] = array("threadid" => 26816 ...);$pack = array(
"totalCount" => count($data),
"topics" => $data
);echo json_encode($pack);*/reader: new Ext.data.JsonReader({
root: 'topics',
totalProperty: 'totalCount', // 數據總跳數,用於計算分多少頁
id: 'threadid', // 數據需要有ID
fields: [ // 欄位列表
'title', 'forumtitle', 'forumid', 'author',
{name: 'replycount', type: 'int'},
{name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},
'lastposter', 'excerpt' // lastpost傳過來的是timestamp格式
]
}),
// turn on remote sorting 在遠程進行排序
remoteSort: true
});
store.setDefaultSort('lastpost', 'desc'); // 默認排序方式// pluggable renders 特殊的欄位顯示Render
function renderTopic(value, p, record){ // value為欄位當前值, p ? , record為整個記錄
return String.format( // String使用 {0},{1}作為佔位幅
'<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b><a href="http://extjs.com/forum/forumdisplay.php?f={3}" target="_blank">{1} Forum</a>',
value, record.data.forumtitle, record.id, record.data.forumid);
}
function renderLast(value, p, r){
return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);
}
// 列顯示模型 (Column Model)var cm = new Ext.grid.ColumnModel([{
id: 'topic', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })
header: "Topic",
dataIndex: 'title',
width: 420,
renderer: renderTopic // 使用特殊的Renderer
},{
header: "Author",
dataIndex: 'author',
width: 100,
hidden: true // 默認隱藏
},{
header: "Replies",
dataIndex: 'replycount',
width: 70,
align: 'right' // 對齊方式
},{
id: 'last',
header: "Last Post",
dataIndex: 'lastpost',
width: 150,
renderer: renderLast // 特殊render
}]);// by default columns are sortable
cm.defaultSortable = true;// Grid Panelvar grid = new Ext.grid.GridPanel({
el:'topic-grid', // DiV容器顯示GridPanel, 在HTML中<div id="topic-grid"></div>
width:700,
height:500,
title:'ExtJS.com - Browse Forums',
store: store,
cm: cm,
trackMouseOver:false,
sm: new Ext.grid.RowSelectionModel({selectRow:Ext.emptyFn}), // 不能Select ?
loadMask: true, // 顯示載入提示
viewConfig: {
forceFit:true,
enableRowBody:true,
showPreview:true, // 是否顯示摘要
getRowClass : function(record, rowIndex, p, store){
if(this.showPreview){
p.body = '<p>'+record.data.excerpt+'</p>';
return 'x-grid3-row-expanded';
}
return 'x-grid3-row-collapsed';
}
},
bbar: new Ext.PagingToolbar({ // 重要的分頁工具
pageSize: 25, // 每頁條數
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}', // 右下角提示
emptyMsg: "No topics to display", // 無記錄
items:[ // show preview 顯示按鈕
'-', {
pressed: true,
enableToggle:true,
text: 'Show Preview',
cls: 'x-btn-text-icon details',
toggleHandler: toggleDetails // handler函數
}]
})
}); // render it
grid.render();// trigger the data store load
store.load({params:{start:0, limit:25}}); // 載入初始數據function toggleDetails(btn, pressed){
var view = grid.getView();
view.showPreview = pressed;
view.refresh();
}
});
JS代碼注釋:Ext.onReady(function(){// create the Data Store
var store = new Ext.data.Store({
// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
// proxy: new Ext.data.ScriptTagProxy({
proxy: new Ext.data.HttpProxy({
url: 'debug.php' // 後端PHP
}),// create reader that reads the Topic records/* 後端PHP輸出格式 PHP 接收的$_REQUEST參數

閱讀全文

與extjsgrid刪除行相關的資料

熱點內容
玉米win10系統下載 瀏覽:134
fgo技能升級減cd嗎 瀏覽:129
什麼記賬app免費好用 瀏覽:441
網路檢測可以檢測到什麼 瀏覽:504
sip協議教程 瀏覽:832
編程哪裡可以接項目 瀏覽:119
孤島驚魂win10 瀏覽:246
網路HRV是什麼意思 瀏覽:918
word框中打勾 瀏覽:577
tcl筆試題java 瀏覽:467
win10怎麼登錄安全模式 瀏覽:679
除了archdaily還有什麼網站 瀏覽:567
數控下料圓形怎麼編程 瀏覽:785
安裝游戲在文件管理找不到怎麼辦 瀏覽:216
想買奢侈包包下載什麼app 瀏覽:1000
閃送員是哪裡的app 瀏覽:530
火車站進站閘機的數據哪裡可以查 瀏覽:503
cad備份文件清理軟體 瀏覽:822
夾具裝配圖cad文件百度網盤 瀏覽:567
如何將excel表格轉成文件包 瀏覽:1

友情鏈接