miholeus

Untitled

Feb 12th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     // серия
  2.     var series_comboBox = new Ext.form.ComboBox({
  3.         value           :  options['series_id'],
  4.         hiddenName      :  'series_id',
  5.         hidden          :  false,
  6.         store           :  new Ext.data.JsonStore({
  7.             url:'modules/router.php',
  8.             baseParams:{
  9.                 action:'content/manufacturers.productSeries',
  10.                 manufacturer_id: options['manufacturers_id'],
  11.                 cat_id: options['categories_id']
  12.             },
  13.             sortInfo:{ field:'title', direction:'ASC' },
  14.             root:'records',
  15.             fields:[
  16.                 { type:'int', name:'id' },
  17.                 { type:'string', name:'title' }
  18.             ],
  19.             autoLoad: true
  20.         }),
  21.         fieldLabel      :  'Серия',
  22.         displayField    :  'title',
  23.         valueField      :  'id',
  24.         triggerAction   :  'all',
  25.         mode            :  'remote',
  26.         editable        :  User.getPerm('content', 'addproductseries'),
  27.         width           :  165,
  28.         listWidth       :  187,
  29.         emptyText       :  'укажите серию'
  30.     }).on('beforeshow', function(el)
  31.     {
  32.         console.log("here");
  33.         Ext.Ajax.request({
  34.             url     : '/modules/router.php',
  35.             async   : false,
  36.             params  : {
  37.                 action : 'content/manufacturers.isEnabled',
  38.                 manufacturer_id: options['manufacturers_id'],
  39.                 cat_id: options['categories_id']
  40.             },
  41.             success : function (res) {
  42.                 var result = Ext.decode(res.responseText);
  43.                 if (result.success) {
  44.                     el.hidden = false;
  45.                 } else {
  46.                     el.hidden = true;
  47.                 }
  48.             },
  49.             failure : function (res) {
  50.                 console.log(res);
  51.                 el.hidden = true;
  52.             }
  53.         });
  54.     });
Advertisement
Add Comment
Please, Sign In to add comment