পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Friday, February 17, 2017

Ext.js - Class System

Ext JS is a JavaScript framework which has functionalities of object oriented programming. Ext is the namespace which encapsulates all the classes in Ext JS.
Defining a class in Ext JS

Ext provides more than 300 classes which we can use for various functionalities.
Ext.define() is used for defining classes in Ext JS.
Syntax:
Ext.define(class name, class members/properties, callback function);
Class name is the name of class according to app structure e.g. appName.folderName.ClassName studentApp.view.StudentView.
Class properties/members - which define the behavior of class.
Callback function is optional. It is called when the class has loaded properly.
Example of Ext JS class definition
Ext.define(studentApp.view.StudentDeatilsGrid, {
   extend : 'Ext.grid.GridPanel',
   id : 'studentsDetailsGrid',
   store : 'StudentsDetailsGridStore',
   renderTo : 'studentsDetailsRenderDiv',
   layout : 'fit',
   columns : [{
      text : 'Student Name',
      dataIndex : 'studentName'
   },{
      text : 'ID',
      dataIndex : 'studentId'
   },{
      text : 'Department',
      dataIndex : 'department'
   }]
});
Creating Objects
As like other OOPS based languages we can create objects in Ext JS as well.
Different ways of creating objects in Ext JS-
Using new keyword:
var studentObject = new student();
studentObject.getStudentName();
Using Ext.create():
Ext.create('Ext.Panel', {
   renderTo : 'helloWorldPanel',
   height : 100,
   width : 100,
   title : 'Hello world',
   html :  'First Ext JS Hello World Program'  
});
Inheritance in Ext JS
Inheritance is the principle of using functionality defined in class A into class B.
In Ext JS inheritance can be done using two methods-
Ext.extend:
Ext.define(studentApp.view.StudentDetailsGrid, {
   extend : 'Ext.grid.GridPanel',
   ...
});
Here our custom class StudentDetailsGrid is using basic features of Ext JS class GridPanel.
Using Mixins:
Mixins is the different way of using class A in class B without extend.
mixins : {
   commons : 'DepartmentApp.utils.DepartmentUtils'
},
Mixins we add in controller where we declare all the other classes such as store, view etc. In this way we can call DepartmentUtils class and use its functions in controller or in this application.

No comments:

Post a Comment