//we want to setup a model and store instead of using dataUrl Ext.define('Task', { extend: 'Ext.data.Model', fields: [ {name: 'task', type: 'string'}, {name: 'user', type: 'string'}, {name: 'duration', type: 'string'} ] }); var store = Ext.create('Ext.data.TreeStore', { model: 'Task', proxy: { type: 'ajax', //the store will get the content from the .json file url: 'treegrid-data.json' }, folderSort: true });
//Ext.ux.tree.TreeGrid在UX扩展中也有,但不常用,您可以简单地使用一个tree.TreePanel var tree = Ext.create('Ext.tree.Panel', { title: 'Core Team Projects', width: 500, height: 300, renderTo: 'treegrid', collapsible: true, useArrows: true, rootVisible: false, store: store, multiSelect: true, singleExpand: true,
//the 'columns' property is now 'headers' columns: [{ xtype: 'treecolumn', //this is so we know which column will show the tree text: 'Task', flex: 2, sortable: true, dataIndex: 'task' },{ //we must use the templateheader component so we can use a custom tpl xtype: 'templatecolumn', text: 'Duration', flex: 1, sortable: true, dataIndex: 'duration', align: 'center', //add in the custom tpl for the rows tpl: Ext.create('Ext.XTemplate', '{duration:this.formatHours}', { formatHours: function(v) { if (v < 1) { return Math.round(v * 60) + ' mins'; } else if (Math.floor(v) !== v) { var min = v - Math.floor(v); return Math.floor(v) + 'h ' + Math.round(min * 60) + 'm'; } else { return v + ' hour' + (v === 1 ? '' : 's'); } } }) },{ text: 'Assigned To', flex: 1, dataIndex: 'user', sortable: true }, { xtype: 'checkcolumn', header: 'Done', dataIndex: 'done', width: 40, stopSelection: false }, { text: 'Edit', width: 40, menuDisabled: true, xtype: 'actioncolumn', tooltip: 'Edit task', align: 'center', icon: '../MyDemo/images/edit.png', handler: function(grid, rowIndex, colIndex, actionItem, event, record, row) { Ext.Msg.alert('Editing' + (record.get('done') ? ' completed task' : '') , record.get('task')); } }] }); });
/*
*开发触发器
*/
--得到日期是周几
select to_char(sysdate+4,'DY','nls_date_language=AMERICAN') from dual;
select to_char(sysdate,'DY','nls_date_language=AMERICAN') from dual;
--建立BEFORE语句触发器
CREATE O
下面给大家整理了一些vim NERDTree的常用快捷键了,这里几乎包括了所有的快捷键了,希望文章对各位会带来帮助。
切换工作台和目录
ctrl + w + h 光标 focus 左侧树形目录ctrl + w + l 光标 focus 右侧文件显示窗口ctrl + w + w 光标自动在左右侧窗口切换ctrl + w + r 移动当前窗口的布局位置
o 在已有窗口中打开文件、目录或书签,并跳