Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1.
  2. // Displays the valueField after change
  3. 2.
  4.  
  5. 3. {
  6.     "name": "agency",
  7.     "width": 172,
  8.     "filterable": true,
  9.     "editable": true,
  10.     "header": "Agency",
  11.     "editor": {
  12.         "displayField": "display",
  13.         "fieldLabel": "Agency",
  14.         "xtype": "combo",
  15.         "required": true,
  16.         "blankText": "agency :",
  17.         "hiddenName": "agency",
  18.         "readOnly": false,
  19.         "allowBlank": false,
  20.         "mode": "local",
  21.         "valueField": "id",
  22.         "triggerAction": "all",
  23.         "store": new Ext.data.SimpleStore({
  24.             fields: ['id', 'display'],
  25.             data: [
  26.                 [1, "BBDO"],
  27.                 [2, "Publicis"],
  28.                 [3, "Ogilvy & Mather NY"],
  29.                 [4, "Hill Holliday"],
  30.                 [5, "Standard Time"],
  31.                 [6, "Leo Burnett"]
  32.             ]
  33.         }),
  34.         "name": "agency"
  35.     }
  36.     4.
  37.  
  38.     5.
  39.  
  40.     6.
  41.     // Displays the displayField after change
  42.     7. {
  43.         "name": "status",
  44.         "filterable": true,
  45.         "editable": true,
  46.         "header": "Status",
  47.         "editor": {
  48.             "displayField": "display",
  49.             "fieldLabel": "Status",
  50.             "xtype": "combo",
  51.             "required": true,
  52.             "blankText": "status :",
  53.             "hiddenName": "status",
  54.             "readOnly": false,
  55.             "allowBlank": false,
  56.             "mode": "local",
  57.             "valueField": "id",
  58.             "triggerAction": "all",
  59.             "store": new Ext.data.SimpleStore({
  60.                 fields: ['id', 'display'],
  61.                 data: [
  62.                     [0, "Completed"],
  63.                     [1, "Not Started"],
  64.                     [2, "Cancelled"],
  65.                     [3, "In Progress"],
  66.                     [4, "Paused"]
  67.                 ]
  68.             }),
  69.             "name": "status"
  70.         },
  71.         "renderer": function (v) {
  72.             a = {
  73.                 "0": "Completed",
  74.                 "1": "Not Started",
  75.                 "2": "Cancelled",
  76.                 "3": "In Progress",
  77.                 "4": "Paused"
  78.             };
  79.             return a[v] || "";
  80.         }
  81.     },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement