+1 vote
in JavaScript by
How to Defining a Class in Ext JS?

1 Answer

0 votes
by

If you want to define a class in Ext JS, then you have to use Ext.define().

Syntax

  1. Ext.define(class name, class member/ properties, callback function);  

Here, we have discussed all the values of the syntax.

Class Name: It is the class name that is given by the user depending upon the application structure.

Class Member/Properties: Class member/properties are used to determine the class behavior.

Callback Function: It is a function that is invoked when the class is loaded. It is an optional function to use.

Example

  1. Ext.define (employeeApp.view.EmployeeDetailsGrid,  
  2. {  
  3. extend : 'Ext.grid.GridPanel',  
  4. id : 'employeesDetailsGrid',  
  5. store : 'EmployeesDetailsGridStore',  
  6. renderTo : 'employeesDetailsRenderDiv',  
  7. layout : 'fit',  
  8. columns : [{  
  9. text : 'Employee Name',  
  10. dataIndex : 'employeeName'  
  11. }, {  
  12. text : 'ID',  
  13. dataIndex : 'employeeId'  
  14. }, {  
  15. text : 'Department',  
  16. dataIndex : 'department'  
  17. }]  
  18. });

Related questions

+1 vote
+1 vote
asked Aug 17, 2020 in JavaScript by RShastri
+1 vote
0 votes
0 votes
asked Aug 16, 2020 in JavaScript by RShastri
0 votes
asked Mar 23, 2021 in JavaScript by sharadyadav1986
...