淺談EasyUI中編輯treegrid的方法
更新時間:2015年03月01日 15:04:36 投稿:hebedich
本文給大家介紹的是在EasyUI中編輯treegid的方法,并附上具體的實(shí)例,這里推薦給大家,有需要的小伙伴快來參考下吧。
主從表,從表是一個treegrid,加載完數(shù)據(jù)后,點(diǎn)擊節(jié)點(diǎn)進(jìn)入編輯狀態(tài)。
復(fù)制代碼 代碼如下:
columns : [ [ {
title : "ID",
field : "id",
hidden : true
}, {
field : "pid",
hidden : true
}, {
title : "AAA",
field : "aaa",
width : 70,
align : "center",
halign : "center"
}, {
title : "BBB",
field : "bbb",
width : 70,
align : "center",
halign : "center",
editor : {
type : "combobox",
options : {
data : [ {
"id" : 0,
"text" : "蘋果"
}, {
"id" : 1,
"text" : "梨子"
} ],
valueField : 'id',
textField : 'text',
editable : false,
// required : true,
panelHeight : "auto",
missingMessage : "請選擇水果",
onSelect : function(record) {
//editingId是進(jìn)入編輯狀態(tài)行的id
var editors = $('#grid').datagrid('getEditors', $('#editingId').val());
if(record.id == 1){//選擇梨子
var feditor = editors[1];//一行中第二個編輯框
//將編輯框設(shè)置成必填
$(feditor.target).validatebox({required:true});
//將編輯框設(shè)置成可編輯
$(feditor.target).numberbox('enable');
var feditor2 = editors[2];//一行中第三個編輯框
$(feditor2.target).validatebox({required:true});
}else if(record.id == 0){//選擇蘋果
var feditor = editors[1];
$(feditor.target).validatebox({required:false});
$(feditor.target).validatebox("setValue","");
$(feditor.target).numberbox('disable');
var feditor2 = editors[2];
$(feditor2.target).validatebox({required:false});
$(feditor2.target).validatebox("setValue","");
}
},
}
}
}
開啟編輯狀態(tài)
復(fù)制代碼 代碼如下:
$('#rulesgrid').treegrid('beginEdit', index);
以上就是本文關(guān)于EasyUI中編輯treegrid的方法,希望大家能夠喜歡。
您可能感興趣的文章:
- Easyui Treegrid改變默認(rèn)圖標(biāo)的方法
- Jquery EasyUI實(shí)現(xiàn)treegrid上顯示checkbox并取選定值的方法
- 淺談EasyUI中Treegrid節(jié)點(diǎn)的刪除
- jquery easyui中treegrid用法的簡單實(shí)例
- EASYUI TREEGRID異步加載數(shù)據(jù)實(shí)現(xiàn)方法
- EasyUI的treegrid組件動態(tài)加載數(shù)據(jù)問題的解決辦法
- jQuery EasyUI API 中文文檔 - TreeGrid 樹表格使用介紹
- jQuery EasyUI的TreeGrid查詢功能實(shí)現(xiàn)方法
相關(guān)文章
3kb jQuery代碼搞定各種樹形選擇的實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄?kb jQuery代碼搞定各種樹形選擇的實(shí)現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-06-06jQuery+Cookie實(shí)現(xiàn)切換皮膚功能【附源碼下載】
這篇文章主要介紹了jQuery+Cookie實(shí)現(xiàn)切換皮膚功能,結(jié)合完整實(shí)例形式分析了jQuery結(jié)合cookie動態(tài)變換頁面元素樣式的相關(guān)操作技巧,并附帶源碼供讀者下載參考,需要的朋友可以參考下2018-03-03jQuery動態(tài)加載css文件實(shí)現(xiàn)方法
使用jQuery來加載一個外部的 css 文件,首先創(chuàng)建一個 link 元素,并將它添加到 標(biāo)記中即可。那么基于jquery代碼如何實(shí)現(xiàn)呢?下面小編給大家介紹jQuery動態(tài)加載css文件實(shí)現(xiàn)方法,需要的朋友參考下吧2016-06-06基于jquery實(shí)現(xiàn)人物頭像跟隨鼠標(biāo)轉(zhuǎn)動
一款非常乖巧的人物頭像跟隨鼠標(biāo)轉(zhuǎn)動效果,在瀏覽器屏幕內(nèi),人物臉龐始終面向鼠標(biāo)轉(zhuǎn)動,本篇文章給大家介紹基于jquery實(shí)現(xiàn)人物頭像跟隨鼠標(biāo)轉(zhuǎn)動,有需要的朋友可以參考下2015-08-08jquery通過name屬性取值的簡單實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄猨query通過name屬性取值的實(shí)現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-06-06