中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

jEasyUI 擴(kuò)展編輯器

一些常見的編輯器(editor)添加到數(shù)據(jù)網(wǎng)格(datagrid),以便用戶編輯數(shù)據(jù)。 所有的編輯器(editor)都定義在 $.fn.datagrid.defaults.editors 對(duì)象中,這個(gè)可以繼承擴(kuò)展以便支持新的編輯器(editor)。 本教程將向您展示如何添加一個(gè)新的 numberspinner 編輯器到數(shù)據(jù)網(wǎng)格(datagrid)。

繼承擴(kuò)展 numberspinner 編輯器

????$.extend($.fn.datagrid.defaults.editors, {
????????numberspinner: {
????????????init: function(container, options){
????????????????var input = $('<input type="text">').appendTo(container);
????????????????return input.numberspinner(options);
????????????},
????????????destroy: function(target){
????????????????$(target).numberspinner('destroy');
????????????},
????????????getValue: function(target){
????????????????return $(target).numberspinner('getValue');
????????????},
????????????setValue: function(target, value){
????????????????$(target).numberspinner('setValue',value);
????????????},
????????????resize: function(target, width){
????????????????$(target).numberspinner('resize',width);
????????????}
????????}
????});

在 html 標(biāo)記中創(chuàng)建數(shù)據(jù)網(wǎng)格(DataGrid)

????<table id="tt" style="width:600px;height:250px"
????????????url="data/datagrid_data.json" title="Editable DataGrid" iconCls="icon-edit"
????????????singleSelect="true" idField="itemid" fitColumns="true">
????????<thead>
????????????<tr>
????????????????<th field="itemid" width="60">Item ID</th>
????????????????<th field="listprice" width="80" align="right" editor="{type:'numberbox',options:{precision:1}}">List Price</th>
????????????????<th field="unitcost" width="80" align="right" editor="numberspinner">Unit Cost</th>
????????????????<th field="attr1" width="180" editor="text">Attribute</th>
????????????????<th field="status" width="60" align="center" editor="{type:'checkbox',options:{on:'P',off:''}}">Status</th>
????????????????<th field="action" width="80" align="center" formatter="formatAction">Action</th>
????????????</tr>
????????</thead>
????</table>

我們分配 numberspinner 編輯器到 'unit cost' 字段。 當(dāng)開始編輯一行,用戶可以通過 numberspinner 編輯器來編輯數(shù)據(jù)。