extjs 如何給column 加上提示,extjscolumn
<script type="text/javascript"src="${pageContext.request.contextPath }/extjs/examples/simple-widgets/qtips.js"></script>renderer : function(value, metaData, record, rowIndex,colIndex, store) {// provide the logic depending on business rules// name of your own choosing to manipulate the cell// depending upon// the data in the underlying Record object.// metaData.css : String : A CSS class name to add// to the TD element of the cell.// metaData.attr : String : An html attribute// definition string to apply to// the data container element within the table// cell (e.g. 'style="color:red;"').metaData.attr = 'ext:qtip="' + value + '"';return value;}
Extjs40中怎添加儲存格的滑鼠懸浮事件?
通過Ext.grid.Column的renderer屬性,自訂一個render函數、在裡面用html標籤的tip
或者用Ext.QuickTip
extjs中的columntree載入樹表格後,怎在每行的最後一列中加編輯超鏈,點超鏈快顯視窗可載入該行資料編輯
1.column-data.json裡面的user欄位改成:
user:'<a href="javascript:void(0)" onclick="newWin()">edit</a>'
2.我建立了一個js來放Ext.Window的,在window嵌入了Ext.form.FormPanel,Ext.form.FormPanel比較好布局,代碼如下:
var newWin=function(){
var win=new Ext.Window({
modal:true,
id:'win',
title:'Edit data',
width:400,
autoHight:true,
closeAction:'close',
items:[newForm()]
});
win.show();
setTimeout(getValue,100)
};
var getValue=function(){
var tree=Ext.getCmp('tree');
var formpanel=Ext.getCmp('formpanel');
var sm=tree.getSelectionModel();
var node=sm.getSelectedNode().attributes;
alert("task:"+node.task+"--duration:"+node.duration);
formpanel.findById('task').setValue(node.task);
formpanel.findById('duration').setValue(node.duration);
};
var newForm=function(){
var formpanel=new Ext.form.FormPanel({
labelWidth:80,
border:false,
id:'formpanel',
bodyStyle: 'padding:15px;background:transparent',
labelSeparator:':',
lableAlign:'right',
items:[
new Ext.form.TextField({
fieldLabel:'task',
width:200,
id:'task'
}),
new Ext.form.TextField({
fieldLabel:'duration',
width:150,
id:'duration'
})],
buttons:[
{text:'ok'},
{text:'cancel'}
]
}
);
return formpanel;
};
...餘下全文>>