Submitted by Anonymous (not verified) on Thu, 04/30/2015 - 00:00
Forums

Hi,

How can I incorporate my own dropdown box in my IceBreak – extjs program?

- Peter

Niels Liisberg

Thu, 04/30/2015 - 00:00

Hi Peter;

In the subrutine in “UserInterface” in your wrksup01.aspx you need to call the generator of get xtype (your dropdown) in your case CtyCdeDD.aspx

//' ------------------------------------------------------------------------------------
//' Build and run the user interface
//' ------------------------------------------------------------------------------------
begsr UserInterface;

// Registre xtypes

// This is the program name of you xtype. Will be called and expand to the class definition
regClass('CTYCDEDD');

%>
//' Override prototypes
if(Ext.form.DateField){
   Ext.apply(Ext.form.DateField.prototype, {
      format : Ext.form.DateField.prototype.format.replace(/y/, 'Y')
      //format : "d-m-Y"
   });
….

This is done by the “regClass”. It simply does a normal call to the program which returns the xtype definition and register the class (hence the name regClass).

So you need in the above:

regClass(‘CTYCDEDD’); // This is the program name of your xtype
Classes and xtype in extjs are same same.
Now you need to use the class. In the “tabPanel” function where your postcode is (I assume its the postcode dropdown … :)

,{

      title:'tab 2',
      layout:'form',
      defaults: {width: 230, msgTarget: 'under'},
      defaultType: 'textfield',
      items:[
  {xtype: 'hidden', name: 'panelId', value: panelId},
 /* Change this line...
  {fieldLabel: 'Post code 1', id: panelId + 'PCD105', name: 'PCD105', value: row.data['PCD105'] },
  .. to use the xtype and map the name of the row data: */
  {xtype: 'CTYCDEDD' , id: panelId + 'PCD105', name: 'PCD105', value: row.data['PCD105'] },
 {fieldLabel: 'Post code 2', id: panelId + 'PCD205', name: 'PCD205', value: 
row.data['PCD205'] },
  {fieldLabel: 'Payment Address Code', id: panelId + 'PYAD05', name: 'PYAD05', value: 
row.data['PYAD05'] },
 {fieldLabel: 'Supplier Group Code 1', id: panelId + 'SGP105', name: 'SGP105', value: 
row.data['SGP105'] },
  {fieldLabel: 'Supplier Group Code 2', id: panelId + 'SGP205', name: 'SGP205', value: 
row.data['SGP205'] },
  {fieldLabel: 'Supplier Group Code 3', id: panelId + 'SGP305', name: 'SGP305', value: 
row.data['SGP305'] },
  {fieldLabel: 'Supplier Group Code 4', id: panelId + 'SGP405', name: 'SGP405', value: 
row.data['SGP405'] },
  {fieldLabel: 'VAT code', id: panelId + 'VCOD05', name: 'VCOD05', value: 
row.data['VCOD05'] },
 {fieldLabel: 'Telephone number', id: panelId + 'PHON05', name: 'PHON05', value: 
row.data['PHON05'] },
 {fieldLabel: 'Special instructions', id: panelId + 'SPIN05', name: 'SPIN05', value: 
row.data['SPIN05'] }]
 },

Thats all there is to it… You can do any xtypes you want: Static by javascript. Dynamic – by IceBreak aspx program.

Xtypes is a big mountain of LEGO …

Best regards,

Niels Liisberg