Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.46 KB | None | 0 0
  1. {
  2. // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
  3. // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
  4. // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
  5. // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  6. // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
  7. // Placeholders with the same ids are connected.
  8. // Example:
  9. // "Print to console": {
  10. // "scope": "javascript,typescript",
  11. // "prefix": "log",
  12. // "body": [
  13. // "console.log('$1');",
  14. // "$2"
  15. // ],
  16. // "description": "Log output to console"
  17. // }
  18.  
  19.  
  20. "xajax": {
  21. "scope": "javascript,php",
  22. "prefix": "xajax",
  23. "description": "",
  24. "body":[
  25. "Ext.Ajax.request({",
  26. " url:'$1',",
  27. " method:'GET',",
  28. " params: {id: id},",
  29. " success: function (request){",
  30. " var req = Ext.decode(request.responseText, true);",
  31. " }",
  32. "});"
  33. ],
  34. },
  35. "xcontainer": {
  36. "scope": "javascript,php",
  37. "prefix": "xcontainer",
  38. "description": "",
  39. "body":[
  40. "{",
  41. " xtype:'container',",
  42. " layout:{type:'${1|vbox,hbox|}', pack:'start', align:'stretch',},",
  43. " items: [",
  44. " $2",
  45. " ]",
  46. "}"
  47. ],
  48. },
  49. "xgrid": {
  50. "scope": "javascript,php",
  51. "prefix": "xgrid",
  52. "description": "",
  53. "body":[
  54. "{",
  55. " xtype: 'grid',",
  56. " ref: '',",
  57. " scrollable: true,",
  58. " store: Ext.create('.store.'),",
  59. " listeners: {},",
  60. " columnLines: true,",
  61. " columns: [",
  62. " {dataIndex: '', header: '', },",
  63. " ]",
  64. "},"
  65. ],
  66. },
  67. "xgrid-filter": {
  68. "scope": "javascript,php",
  69. "prefix": "xgrid-filter",
  70. "description": "",
  71. "body":[
  72. "plugins: ['gridfilters'],"
  73. ],
  74. },
  75. "xgrid-group": {
  76. "scope": "javascript,php",
  77. "prefix": "xgrid-group",
  78. "description": "",
  79. "body":[
  80. "features: [{ftype:'grouping', groupHeaderTpl: ': {groupValue} ({children.length})'}],"
  81. ],
  82. },
  83. "xgrid-group-render": {
  84. "scope": "javascript,php",
  85. "prefix": "xgrid-group-render",
  86. "description": "",
  87. "body":[
  88. "/*groupField,columnName,groupValue,renderedGroupValue,children*/",
  89. "groupHeaderTpl: [",
  90. " 'Group: ',",
  91. " '<div>{name:this.foo$1}</div>',",
  92. " {",
  93. " foo$1: function(name) {",
  94. " return name;",
  95. " }",
  96. " }",
  97. "],"
  98. ],
  99. },
  100. "xgrid-dock": {
  101. "scope": "javascript,php",
  102. "prefix": "xgrid-dock",
  103. "description": "",
  104. "body":[
  105. "dockedItems: [",
  106. " {",
  107. " xtype: 'toolbar',",
  108. " dock: 'top',",
  109. " items: [{}]",
  110. " }",
  111. ","
  112. ],
  113. },
  114. "xgrid-design": {
  115. "scope": "javascript,php",
  116. "prefix": "xgrid-design",
  117. "description": "",
  118. "body":[
  119. "/* Conditional row style */",
  120. "viewConfig: {",
  121. " stripeRows: false,",
  122. " getRowClass: function(record) {",
  123. " return record.get('age') < 18 ? 'child-row' : 'adult-row';",
  124. " }",
  125. "},",
  126. "columns: [",
  127. " /* Column style */",
  128. " {dataIndex: 'age', text: 'Age', tdCls: 'custom-column'},",
  129. " /* Cell style */",
  130. " {",
  131. " dataIndex: 'sex',",
  132. " text: 'Sex',",
  133. " renderer: function(value, meta) {",
  134. " if (value === 'M') {",
  135. " meta.tdCls = 'male-cell';",
  136. " return 'Male';",
  137. " }",
  138. "",
  139. " meta.tdCls = 'female-cell';",
  140. " return 'Female';",
  141. " }",
  142. " }",
  143. "],"
  144. ],
  145. },
  146. "xgrid-celledit": {
  147. "scope": "javascript,php",
  148. "prefix": "xgrid-celledit",
  149. "description": "",
  150. "body":[
  151. "plugins: [{",
  152. " ptype: 'cellediting',",
  153. " clicksToEdit: 1",
  154. "}],"
  155. ],
  156. },
  157. "xgrid-celledit-listeners": {
  158. "scope": "javascript,php",
  159. "prefix": "xgrid-celledit-listeners",
  160. "description": "",
  161. "body":[
  162. "listeners: {",
  163. " edit|beforeedit|canceledit|validateedit: function (editor, context) {",
  164. " /*context: [",
  165. " grid: The owning grid Panel.",
  166. " record: The record being edited.",
  167. " field: The name of the field being edited.",
  168. " value: The field's current value.",
  169. " row: The grid row element.",
  170. " column: Ext.grid.column.Column Column} being edited.",
  171. " rowIdx: The index of the row being edited.",
  172. " colIdx: The index of the column being edited.",
  173. " originalValue : The original value before being edited.",
  174. " cancel : [only on beforeedit & validateedit] Set this to true to cancel the edit or return false from your handler.",
  175. " ] */",
  176. " },",
  177. "},"
  178. ],
  179. },
  180. "xgrid-check": {
  181. "scope": "javascript,php",
  182. "prefix": "xgrid-check",
  183. "description": "",
  184. "body":[
  185. "selModel: {",
  186. " selType: 'checkboxmodel',",
  187. " toggleOnClick: false,",
  188. "},",
  189. "$LINE_COMMENT or",
  190. "{",
  191. " xtype: 'checkcolumn',",
  192. " header: 'Pagar',",
  193. " dataIndex: 'pagar',",
  194. " stopSelection: false,",
  195. "},"
  196. ],
  197. },
  198. "xgrid-summary": {
  199. "scope": "javascript,php",
  200. "prefix": "xgrid-summary",
  201. "description": "",
  202. "body":[
  203. "features: [{
  204. ftype: 'summary',
  205. dock: 'bottom'
  206. }],"
  207. ],
  208. },
  209. "xgrid-summary-render": {
  210. "scope": "javascript,php",
  211. "prefix": "xgrid-summary-render",
  212. "description": "",
  213. "body":[
  214. "summaryType: function (recs) {",
  215. " var suma = 0;",
  216. " recs.forEach(function (rec, i) {",
  217. " if(rec.get('check'))",
  218. " suma += rec.get('valor');",
  219. " });",
  220. " return suma;",
  221. "},",
  222. "summaryRenderer: function (value, summaryData, dataIndex) {",
  223. " return Ext.util.Format.number(value, '0,000.##');",
  224. "},"
  225. ],
  226. },
  227. "xwindow": {
  228. "scope": "javascript,php",
  229. "prefix": "xwindow",
  230. "description": "",
  231. "body":[
  232. "Ext.create('Ext.Window', {",
  233. " layout: '$1',",
  234. " closeAction: 'hide',",
  235. " title: '$2',",
  236. " items: [",
  237. " $3",
  238. " ],",
  239. " buttons: [{",
  240. " xtype: 'button',",
  241. " text: 'Cancelar',",
  242. " handler: me => me.up('window').close(),",
  243. " }],",
  244. "}).show();"
  245. ],
  246. },
  247. "xwindow-grid": {
  248. "scope": "javascript,php",
  249. "prefix": "xwindow-grid",
  250. "description": "",
  251. "body":[
  252. "var store = Ext.create('Ext.data.Store',{",
  253. " fields: [",
  254. " {name: '', type:'bool'},",
  255. " ],",
  256. " data: data,",
  257. "});",
  258. "Ext.create('Ext.Window', {",
  259. " title: 'Título',",
  260. " closeAction: 'destroy',",
  261. " layout:'fit',",
  262. " height: 400,",
  263. " width: 600,",
  264. " items: [{",
  265. " xtype: 'grid',",
  266. " scrollable: true,",
  267. " columnLines: true,",
  268. " layout: 'fit',",
  269. " flex: 1,",
  270. " store: store,",
  271. " columns: [",
  272. " {dataIndex: 'something', header:'ColumnTitle',},",
  273. " ]",
  274. " }],",
  275. " buttons: [{",
  276. " xtype: 'button',",
  277. " text: 'Cancelar',",
  278. " handler: me => me.up('window').close();",
  279. " }],",
  280. "}).show();"
  281. ],
  282. },
  283. "xgrid-rowexpander": {
  284. "scope": "javascript,php",
  285. "prefix": "xgrid-rowexpander",
  286. "description": "",
  287. "body":[
  288. "plugins:[",
  289. " {",
  290. " ptype:'rowexpander',",
  291. " expandOnDblClick:false,",
  292. " rowBodyTpl: new Ext.XTemplate(`",
  293. " <tpl if=\"\"></tpl>",
  294. " {value:this.c}",
  295. " `,",
  296. " {c: v => v.property})",
  297. " },",
  298. "],"
  299. ],
  300. },
  301. "xrenderer-mini": {
  302. "scope": "javascript,php",
  303. "prefix": "xrenderer-mini",
  304. "description": "",
  305. "body":[
  306. "renderer:v=>v?true:false,"
  307. ],
  308. },
  309. "xrenderer": {
  310. "scope": "javascript,php",
  311. "prefix": "xrenderer",
  312. "description": "",
  313. "body":[
  314. "renderer: function(v,meta,record,rowIndex,colIndex,store,view){",
  315. " $LINE_COMMENT meta: tdCls, tdAttr, tdStyle",
  316. " $1",
  317. " return v;",
  318. "},"
  319. ],
  320. },
  321. "xutil-num": {
  322. "scope": "javascript,php",
  323. "prefix": "xutil-num",
  324. "description": "",
  325. "body":[
  326. "Ext.util.Format.number($1, '0,000.##')"
  327. ],
  328. },
  329. "xbutton": {
  330. "scope": "javascript,php",
  331. "prefix": "xbutton",
  332. "description": "",
  333. "body":[
  334. "{xtype:'button',text:'$1',handler:function(){$1},},"
  335. ],
  336. },
  337. "xspacer": {
  338. "scope": "javascript,php",
  339. "prefix": "xspacer",
  340. "description": "",
  341. "body":[
  342. "{xtype:'tbspacer', flex:1},"
  343. ],
  344. },
  345. "xcheck": {
  346. "scope": "javascript,php",
  347. "prefix": "xcheck",
  348. "description": "",
  349. "body":[
  350. "{xtype:'checkbox',boxLabel:'$1',name:'$1',inputValue:1,},"
  351. ],
  352. },
  353. "xdate": {
  354. "scope": "javascript,php",
  355. "prefix": "xdate",
  356. "description": "",
  357. "body":[
  358. "{xtype:'datefield',fieldLabel:'$1',name:'$1',value: new Date(),},"
  359. ],
  360. },
  361. "xdisplay": {
  362. "scope": "javascript,php",
  363. "prefix": "xdisplay",
  364. "description": "",
  365. "body":[
  366. "{xtype:'displayfield',fieldLabel:'$1',name:'$1',value:'$1',},"
  367. ],
  368. },
  369. "xfield": {
  370. "scope": "javascript,php",
  371. "prefix": "xfield",
  372. "description": "",
  373. "body":[
  374. "{xtype:'textfield',fieldLabel:'$1',name:'$1',},"
  375. ],
  376. },
  377. "xfieldcontainer": {
  378. "scope": "javascript,php",
  379. "prefix": "xfieldcontainer",
  380. "description": "",
  381. "body":[
  382. "{xtype:'fieldcontainer',layout:'hbox',items:[$1]},"
  383. ],
  384. },
  385. "xhidden": {
  386. "scope": "javascript,php",
  387. "prefix": "xhidden",
  388. "description": "",
  389. "body":[
  390. "{xtype:'hidden',name:'$1',value:'$1',},"
  391. ],
  392. },
  393. "xhtmleditor": {
  394. "scope": "javascript,php",
  395. "prefix": "xhtmleditor",
  396. "description": "",
  397. "body":[
  398. "{xtype:'htmleditor',fieldLabel:'$1',name:'$1',},"
  399. ],
  400. },
  401. "xnumber": {
  402. "scope": "javascript,php",
  403. "prefix": "xnumber",
  404. "description": "",
  405. "body":[
  406. "{xtype:'numberfield',fieldLabel:'$1',name:'$1',},"
  407. ],
  408. },
  409. "xradio": {
  410. "scope": "javascript,php",
  411. "prefix": "xradio",
  412. "description": "",
  413. "body":[
  414. "{xtype:'textfield',boxLabel:'$1',name:'$1',inputValue:1,},"
  415. ],
  416. },
  417. "xtag": {
  418. "scope": "javascript,php",
  419. "prefix": "xtag",
  420. "description": "",
  421. "body":[
  422. "{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,},"
  423. ],
  424. },
  425. "xtextarea": {
  426. "scope": "javascript,php",
  427. "prefix": "xtextarea",
  428. "description": "",
  429. "body":[
  430. "{xtype:'textarea',fieldLabel:'$1',name:'$1',grow: false,},"
  431. ],
  432. },
  433. "xtime": {
  434. "scope": "javascript,php",
  435. "prefix": "xtime",
  436. "description": "",
  437. "body":[
  438. "{xtype:'timefield',fieldLabel:'$1',name:'$1',minValue: '6:00 AM',maxValue: '8:00 PM',increment: 30,},"
  439. ],
  440. },
  441. "xcombo": {
  442. "scope": "javascript,php",
  443. "prefix": "xcombo",
  444. "description": "",
  445. "body":[
  446. "{",
  447. " xtype: 'combo',",
  448. " name: '$1',",
  449. " emptyText: 'Seleccione una opción',",
  450. " triggerAction: 'all',",
  451. " typeAhead: true,",
  452. " forceSelection: true,",
  453. " queryMode: 'local',",
  454. " displayField: 'display',",
  455. " valueField: 'id',",
  456. " store:{",
  457. " fields: ['id', 'display'],",
  458. " data:[",
  459. " { id:0, display:'Ejemplo', },",
  460. " ]",
  461. " },",
  462. " tpl: Ext.create('Ext.XTemplate',",
  463. " '<tpl for=\".\">',",
  464. " '<div class=\"x-boundlist-item\">',",
  465. " '<div style=\"width:300px; display:inline-block; overflow:hidden;white-space:nowrap;text-overflow: ellipsis;\"><b>{display}</b><br />{extra}</div>',",
  466. " '</div>',",
  467. " '</tpl>'",
  468. " ),",
  469. "},"
  470. ],
  471. },
  472. "xmsgfull": {
  473. "scope": "javascript,php",
  474. "prefix": "xmsgfull",
  475. "description": "",
  476. "body":[
  477. "Ext.Msg.show({",
  478. " title: '',",
  479. " msg: '',",
  480. " $LINE_COMMENT buttons: Ext.MessageBox.OK+Ext.MessageBox.YES+Ext.MessageBox.NO+Ext.MessageBox.CANCEL,",
  481. " $LINE_COMMENT animateTarget: x.el,",
  482. " $LINE_COMMENT fn: function(btn, text){},",
  483. " $LINE_COMMENT icon: Ext.MessageBox.INFO|WARNING|QUESTION|ERROR,",
  484. "",
  485. " $LINE_COMMENT defaultFocus: 'yes|ok|no|cancel',",
  486. " $LINE_COMMENT buttonText: {yes:,ok:,no:,cancel:},",
  487. " $LINE_COMMENT multiline: true,",
  488. " $LINE_COMMENT prompt: true,",
  489. " $LINE_COMMENT value: '',",
  490. " $LINE_COMMENT wait:true,",
  491. " $LINE_COMMENT waitConfig:(docs)Ext.ProgressBar.wait,",
  492. " $LINE_COMMENT progress: true,",
  493. "});"
  494. ],
  495. },
  496. "xmsg": {
  497. "scope": "javascript,php",
  498. "prefix": "xmsg",
  499. "description": "",
  500. "body":[
  501. "Ext.Msg.show({",
  502. " title: '$1',",
  503. " msg: '',",
  504. " buttons: Ext.MessageBox.OK,",
  505. " fn: function(btn){},",
  506. " icon: Ext.MessageBox.${2|INFO,WARNING,QUESTION,ERROR|},",
  507. " $LINE_COMMENT animateTarget: x.el,",
  508. "});"
  509. ],
  510. },
  511. "xkeydown": {
  512. "scope": "javascript,php",
  513. "prefix": "xkeydown",
  514. "description": "",
  515. "body":[
  516. "enableKeyEvents: true,",
  517. "listeners: {",
  518. " keydown: function(me, e) {",
  519. " if(e.getKey()==e.ENTER){$1}",
  520. " }",
  521. "},"
  522. ],
  523. },
  524. "xfieldset": {
  525. "scope": "javascript,php",
  526. "prefix": "xfieldset",
  527. "description": "",
  528. "body":[
  529. "{",
  530. " xtype:'fieldset',",
  531. " title: '$1',",
  532. " items: [",
  533. " $2",
  534. " ]",
  535. "},",
  536. ],
  537. },
  538. "xstore": {
  539. "scope": "javascript,php",
  540. "prefix": "xstore",
  541. "description": "",
  542. "body":[
  543. "var xstore = Ext.create('Ext.data.Store', {",
  544. " fields:['name', 'value'],",
  545. " autoLoad: true,",
  546. " data: Ext.decode(data, true),",
  547. "});",
  548. ],
  549. },
  550. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement