extjs 如何給column 加上提示,extjscolumn

來源:互聯網
上載者:User

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;
};

...餘下全文>>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.