Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
- // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
- // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
- // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
- // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
- // Placeholders with the same ids are connected.
- // Example:
- // "Print to console": {
- // "scope": "javascript,typescript",
- // "prefix": "log",
- // "body": [
- // "console.log('$1');",
- // "$2"
- // ],
- // "description": "Log output to console"
- // }
- "xajax": {
- "scope": "javascript,php",
- "prefix": "xajax",
- "description": "",
- "body":[
- "Ext.Ajax.request({",
- " url:'$1',",
- " method:'GET',",
- " params: {id: id},",
- " success: function (request){",
- " var req = Ext.decode(request.responseText, true);",
- " }",
- "});"
- ],
- },
- "xcontainer": {
- "scope": "javascript,php",
- "prefix": "xcontainer",
- "description": "",
- "body":[
- "{",
- " xtype:'container',",
- " layout:{type:'${1|vbox,hbox|}', pack:'start', align:'stretch',},",
- " items: [",
- " $2",
- " ]",
- "}"
- ],
- },
- "xgrid": {
- "scope": "javascript,php",
- "prefix": "xgrid",
- "description": "",
- "body":[
- "{",
- " xtype: 'grid',",
- " ref: '',",
- " scrollable: true,",
- " store: Ext.create('.store.'),",
- " listeners: {},",
- " columnLines: true,",
- " columns: [",
- " {dataIndex: '', header: '', },",
- " ]",
- "},"
- ],
- },
- "xgrid-filter": {
- "scope": "javascript,php",
- "prefix": "xgrid-filter",
- "description": "",
- "body":[
- "plugins: ['gridfilters'],"
- ],
- },
- "xgrid-group": {
- "scope": "javascript,php",
- "prefix": "xgrid-group",
- "description": "",
- "body":[
- "features: [{ftype:'grouping', groupHeaderTpl: ': {groupValue} ({children.length})'}],"
- ],
- },
- "xgrid-group-render": {
- "scope": "javascript,php",
- "prefix": "xgrid-group-render",
- "description": "",
- "body":[
- "/*groupField,columnName,groupValue,renderedGroupValue,children*/",
- "groupHeaderTpl: [",
- " 'Group: ',",
- " '<div>{name:this.foo$1}</div>',",
- " {",
- " foo$1: function(name) {",
- " return name;",
- " }",
- " }",
- "],"
- ],
- },
- "xgrid-dock": {
- "scope": "javascript,php",
- "prefix": "xgrid-dock",
- "description": "",
- "body":[
- "dockedItems: [",
- " {",
- " xtype: 'toolbar',",
- " dock: 'top',",
- " items: [{}]",
- " }",
- ","
- ],
- },
- "xgrid-design": {
- "scope": "javascript,php",
- "prefix": "xgrid-design",
- "description": "",
- "body":[
- "/* Conditional row style */",
- "viewConfig: {",
- " stripeRows: false,",
- " getRowClass: function(record) {",
- " return record.get('age') < 18 ? 'child-row' : 'adult-row';",
- " }",
- "},",
- "columns: [",
- " /* Column style */",
- " {dataIndex: 'age', text: 'Age', tdCls: 'custom-column'},",
- " /* Cell style */",
- " {",
- " dataIndex: 'sex',",
- " text: 'Sex',",
- " renderer: function(value, meta) {",
- " if (value === 'M') {",
- " meta.tdCls = 'male-cell';",
- " return 'Male';",
- " }",
- "",
- " meta.tdCls = 'female-cell';",
- " return 'Female';",
- " }",
- " }",
- "],"
- ],
- },
- "xgrid-celledit": {
- "scope": "javascript,php",
- "prefix": "xgrid-celledit",
- "description": "",
- "body":[
- "plugins: [{",
- " ptype: 'cellediting',",
- " clicksToEdit: 1",
- "}],"
- ],
- },
- "xgrid-celledit-listeners": {
- "scope": "javascript,php",
- "prefix": "xgrid-celledit-listeners",
- "description": "",
- "body":[
- "listeners: {",
- " edit|beforeedit|canceledit|validateedit: function (editor, context) {",
- " /*context: [",
- " grid: The owning grid Panel.",
- " record: The record being edited.",
- " field: The name of the field being edited.",
- " value: The field's current value.",
- " row: The grid row element.",
- " column: Ext.grid.column.Column Column} being edited.",
- " rowIdx: The index of the row being edited.",
- " colIdx: The index of the column being edited.",
- " originalValue : The original value before being edited.",
- " cancel : [only on beforeedit & validateedit] Set this to true to cancel the edit or return false from your handler.",
- " ] */",
- " },",
- "},"
- ],
- },
- "xgrid-check": {
- "scope": "javascript,php",
- "prefix": "xgrid-check",
- "description": "",
- "body":[
- "selModel: {",
- " selType: 'checkboxmodel',",
- " toggleOnClick: false,",
- "},",
- "$LINE_COMMENT or",
- "{",
- " xtype: 'checkcolumn',",
- " header: 'Pagar',",
- " dataIndex: 'pagar',",
- " stopSelection: false,",
- "},"
- ],
- },
- "xgrid-summary": {
- "scope": "javascript,php",
- "prefix": "xgrid-summary",
- "description": "",
- "body":[
- "features: [{
- ftype: 'summary',
- dock: 'bottom'
- }],"
- ],
- },
- "xgrid-summary-render": {
- "scope": "javascript,php",
- "prefix": "xgrid-summary-render",
- "description": "",
- "body":[
- "summaryType: function (recs) {",
- " var suma = 0;",
- " recs.forEach(function (rec, i) {",
- " if(rec.get('check'))",
- " suma += rec.get('valor');",
- " });",
- " return suma;",
- "},",
- "summaryRenderer: function (value, summaryData, dataIndex) {",
- " return Ext.util.Format.number(value, '0,000.##');",
- "},"
- ],
- },
- "xwindow": {
- "scope": "javascript,php",
- "prefix": "xwindow",
- "description": "",
- "body":[
- "Ext.create('Ext.Window', {",
- " layout: '$1',",
- " closeAction: 'hide',",
- " title: '$2',",
- " items: [",
- " $3",
- " ],",
- " buttons: [{",
- " xtype: 'button',",
- " text: 'Cancelar',",
- " handler: me => me.up('window').close(),",
- " }],",
- "}).show();"
- ],
- },
- "xwindow-grid": {
- "scope": "javascript,php",
- "prefix": "xwindow-grid",
- "description": "",
- "body":[
- "var store = Ext.create('Ext.data.Store',{",
- " fields: [",
- " {name: '', type:'bool'},",
- " ],",
- " data: data,",
- "});",
- "Ext.create('Ext.Window', {",
- " title: 'Título',",
- " closeAction: 'destroy',",
- " layout:'fit',",
- " height: 400,",
- " width: 600,",
- " items: [{",
- " xtype: 'grid',",
- " scrollable: true,",
- " columnLines: true,",
- " layout: 'fit',",
- " flex: 1,",
- " store: store,",
- " columns: [",
- " {dataIndex: 'something', header:'ColumnTitle',},",
- " ]",
- " }],",
- " buttons: [{",
- " xtype: 'button',",
- " text: 'Cancelar',",
- " handler: me => me.up('window').close();",
- " }],",
- "}).show();"
- ],
- },
- "xgrid-rowexpander": {
- "scope": "javascript,php",
- "prefix": "xgrid-rowexpander",
- "description": "",
- "body":[
- "plugins:[",
- " {",
- " ptype:'rowexpander',",
- " expandOnDblClick:false,",
- " rowBodyTpl: new Ext.XTemplate(`",
- " <tpl if=\"\"></tpl>",
- " {value:this.c}",
- " `,",
- " {c: v => v.property})",
- " },",
- "],"
- ],
- },
- "xrenderer-mini": {
- "scope": "javascript,php",
- "prefix": "xrenderer-mini",
- "description": "",
- "body":[
- "renderer:v=>v?true:false,"
- ],
- },
- "xrenderer": {
- "scope": "javascript,php",
- "prefix": "xrenderer",
- "description": "",
- "body":[
- "renderer: function(v,meta,record,rowIndex,colIndex,store,view){",
- " $LINE_COMMENT meta: tdCls, tdAttr, tdStyle",
- " $1",
- " return v;",
- "},"
- ],
- },
- "xutil-num": {
- "scope": "javascript,php",
- "prefix": "xutil-num",
- "description": "",
- "body":[
- "Ext.util.Format.number($1, '0,000.##')"
- ],
- },
- "xbutton": {
- "scope": "javascript,php",
- "prefix": "xbutton",
- "description": "",
- "body":[
- "{xtype:'button',text:'$1',handler:function(){$1},},"
- ],
- },
- "xspacer": {
- "scope": "javascript,php",
- "prefix": "xspacer",
- "description": "",
- "body":[
- "{xtype:'tbspacer', flex:1},"
- ],
- },
- "xcheck": {
- "scope": "javascript,php",
- "prefix": "xcheck",
- "description": "",
- "body":[
- "{xtype:'checkbox',boxLabel:'$1',name:'$1',inputValue:1,},"
- ],
- },
- "xdate": {
- "scope": "javascript,php",
- "prefix": "xdate",
- "description": "",
- "body":[
- "{xtype:'datefield',fieldLabel:'$1',name:'$1',value: new Date(),},"
- ],
- },
- "xdisplay": {
- "scope": "javascript,php",
- "prefix": "xdisplay",
- "description": "",
- "body":[
- "{xtype:'displayfield',fieldLabel:'$1',name:'$1',value:'$1',},"
- ],
- },
- "xfield": {
- "scope": "javascript,php",
- "prefix": "xfield",
- "description": "",
- "body":[
- "{xtype:'textfield',fieldLabel:'$1',name:'$1',},"
- ],
- },
- "xfieldcontainer": {
- "scope": "javascript,php",
- "prefix": "xfieldcontainer",
- "description": "",
- "body":[
- "{xtype:'fieldcontainer',layout:'hbox',items:[$1]},"
- ],
- },
- "xhidden": {
- "scope": "javascript,php",
- "prefix": "xhidden",
- "description": "",
- "body":[
- "{xtype:'hidden',name:'$1',value:'$1',},"
- ],
- },
- "xhtmleditor": {
- "scope": "javascript,php",
- "prefix": "xhtmleditor",
- "description": "",
- "body":[
- "{xtype:'htmleditor',fieldLabel:'$1',name:'$1',},"
- ],
- },
- "xnumber": {
- "scope": "javascript,php",
- "prefix": "xnumber",
- "description": "",
- "body":[
- "{xtype:'numberfield',fieldLabel:'$1',name:'$1',},"
- ],
- },
- "xradio": {
- "scope": "javascript,php",
- "prefix": "xradio",
- "description": "",
- "body":[
- "{xtype:'textfield',boxLabel:'$1',name:'$1',inputValue:1,},"
- ],
- },
- "xtag": {
- "scope": "javascript,php",
- "prefix": "xtag",
- "description": "",
- "body":[
- "{xtype:'textfield',fieldLabel:'$1',name:'$1',store: Ext.create('$1.store.$2'),queryMode:'local',displayField: 'display_field',valueField: 'id',grow: false,filterPickList: true,encodeSubmitValue: true,},"
- ],
- },
- "xtextarea": {
- "scope": "javascript,php",
- "prefix": "xtextarea",
- "description": "",
- "body":[
- "{xtype:'textarea',fieldLabel:'$1',name:'$1',grow: false,},"
- ],
- },
- "xtime": {
- "scope": "javascript,php",
- "prefix": "xtime",
- "description": "",
- "body":[
- "{xtype:'timefield',fieldLabel:'$1',name:'$1',minValue: '6:00 AM',maxValue: '8:00 PM',increment: 30,},"
- ],
- },
- "xcombo": {
- "scope": "javascript,php",
- "prefix": "xcombo",
- "description": "",
- "body":[
- "{",
- " xtype: 'combo',",
- " name: '$1',",
- " emptyText: 'Seleccione una opción',",
- " triggerAction: 'all',",
- " typeAhead: true,",
- " forceSelection: true,",
- " queryMode: 'local',",
- " displayField: 'display',",
- " valueField: 'id',",
- " store:{",
- " fields: ['id', 'display'],",
- " data:[",
- " { id:0, display:'Ejemplo', },",
- " ]",
- " },",
- " tpl: Ext.create('Ext.XTemplate',",
- " '<tpl for=\".\">',",
- " '<div class=\"x-boundlist-item\">',",
- " '<div style=\"width:300px; display:inline-block; overflow:hidden;white-space:nowrap;text-overflow: ellipsis;\"><b>{display}</b><br />{extra}</div>',",
- " '</div>',",
- " '</tpl>'",
- " ),",
- "},"
- ],
- },
- "xmsgfull": {
- "scope": "javascript,php",
- "prefix": "xmsgfull",
- "description": "",
- "body":[
- "Ext.Msg.show({",
- " title: '',",
- " msg: '',",
- " $LINE_COMMENT buttons: Ext.MessageBox.OK+Ext.MessageBox.YES+Ext.MessageBox.NO+Ext.MessageBox.CANCEL,",
- " $LINE_COMMENT animateTarget: x.el,",
- " $LINE_COMMENT fn: function(btn, text){},",
- " $LINE_COMMENT icon: Ext.MessageBox.INFO|WARNING|QUESTION|ERROR,",
- "",
- " $LINE_COMMENT defaultFocus: 'yes|ok|no|cancel',",
- " $LINE_COMMENT buttonText: {yes:,ok:,no:,cancel:},",
- " $LINE_COMMENT multiline: true,",
- " $LINE_COMMENT prompt: true,",
- " $LINE_COMMENT value: '',",
- " $LINE_COMMENT wait:true,",
- " $LINE_COMMENT waitConfig:(docs)Ext.ProgressBar.wait,",
- " $LINE_COMMENT progress: true,",
- "});"
- ],
- },
- "xmsg": {
- "scope": "javascript,php",
- "prefix": "xmsg",
- "description": "",
- "body":[
- "Ext.Msg.show({",
- " title: '$1',",
- " msg: '',",
- " buttons: Ext.MessageBox.OK,",
- " fn: function(btn){},",
- " icon: Ext.MessageBox.${2|INFO,WARNING,QUESTION,ERROR|},",
- " $LINE_COMMENT animateTarget: x.el,",
- "});"
- ],
- },
- "xkeydown": {
- "scope": "javascript,php",
- "prefix": "xkeydown",
- "description": "",
- "body":[
- "enableKeyEvents: true,",
- "listeners: {",
- " keydown: function(me, e) {",
- " if(e.getKey()==e.ENTER){$1}",
- " }",
- "},"
- ],
- },
- "xfieldset": {
- "scope": "javascript,php",
- "prefix": "xfieldset",
- "description": "",
- "body":[
- "{",
- " xtype:'fieldset',",
- " title: '$1',",
- " items: [",
- " $2",
- " ]",
- "},",
- ],
- },
- "xstore": {
- "scope": "javascript,php",
- "prefix": "xstore",
- "description": "",
- "body":[
- "var xstore = Ext.create('Ext.data.Store', {",
- " fields:['name', 'value'],",
- " autoLoad: true,",
- " data: Ext.decode(data, true),",
- "});",
- ],
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement