Skip to main content

Posts

Showing posts from August, 2014

EXTJS4 - 2015 Fiddles

EXTJS Fiddles (2015) Grid - Generate Fake store with pagination http://jsfiddle.net/prajavk/Ufeyw/ Grid - Reconfigure grids http://jsfiddle.net/prajavk/t2bVJ/ Grid - Load two stores, hide columns, apply state http://jsfiddle.net/prajavk/P7ES5/ Grid - row expander + grouping http://jsfiddle.net/89Ljt/ Grid - load child grid on row expander http://jsfiddle.net/prajavk/9t3JE/ Nested grid with row expander http://jsfiddle.net/prajavk/3TxkA/ Grid - Preselect checkbox grid http://jsfiddle.net/prajavk/97fXp/ Combo - two fieldsearch http://jsfiddle.net/prajavk/7j4uW/  Grid - cell click event loads child grid http://jsfiddle.net/prajavk/5eq3T/ Grid -Action column with checkbox event http://jsfiddle.net/prajavk/ZLmY6/ Ext.Direct simulator- load nested grids http://jsfiddle.net/prajavk/622kF/ Ext.Ajax comet simulator for continous response http://jsfiddle.net/prajavk/3msnf/ Hasone - model http://jsfiddle.net/prajavk/yLLuG/ Grid - simulate live data http

The Basics of Object-Oriented JavaScript

What is the difference between undefined value and null value? undefined means a variable has been declared but has not yet been assigned a value . On the other hand, null is an assignment value . It can be assigned to a variable as a representation of no value. Also, undefined and null are two distinct types: undefined is a type itself (undefined) while null is an object. Unassigned variables are initialized by JavaScript with a default value of undefined . JavaScript never sets a value to null. That must be done programmatically.   "undefined" is   not  a reserved word in JavaScript. undeclared variables don't even exist undefined variables exist, but don't have anything assigned to them null variables exist and have null assigned to them //eg: undeclaredVariable = 1;  //undeclared, when a variable doesn't use var keyword var x = {}; // empty object var u; // declared, but undefined var n = null; // declared, defined to be null undeclar

EXTJS Code Style Guide with examples

EXTJS Style Guide: -familiar and simple to learn -fast to develop, easy to debug, painless to deploy -well-organized, extensible and maintainable Naming conventions for ExtJS application: 1.Class Class name should be in CamelCased. Do not use underscores, hyphens, or any other nonalphanumeric character. eg: MyCustomClass Classes that are not distributed by Sencha should never use Ext as the top-level namespace. Class name should be with atleast one unique namespace separated by dot (.). eg:TopLevelNamespace.MyClassName The top-level namespaces and the actual class names should be in CamelCased, everything else should be all lower-cased. //Good eg:TopNamespace.midlevelnamespace.MyCustomClass eg:MyModule.view.UserGrid //Bad eg:MyCompany.useful_util.Debug_Toolbar  2.Use Namespaces to Group Related Components Namespaces should be based on directory structures. Directories should group components into logical modules based on functional business components. This

Javascript Code Style Guide with examples

1.Variables, functions, properties methods: // Good var thisIsMyName; var anotherVariable; var aVeryLongVariableName; Methods: // Good function getName() { return myName; } // Bad: Easily confused with variable function theName() { return myName; } Constants: // Good eg: // Changing this value will be problem var MAX_COUNT = 10; var URL = "http://www.mydomain.net/"; if (count < MAX_COUNT) { doSomething(); } Global References:  // Note: Specify about below declaration,where they are used  var globalPreferedMode = false;  var globalUserPreferenceArr = [];  // Array used to compare with preference cols of trade grid while applying preferences 2. Single line comments: eg: // Good if (condition) { // if you made it here, then all security checks passed allowed(); } eg: // Good var result = something + somethingElse; // somethingElse will never be null Multiline comments: eg: // Good if (condition) { /* * if you

EXTJS - Basics of Sencha Cmd?

Sencha Cmd is a command-line suite of tools for building your Sencha applications. Although it has been a part of the Sencha toolbox for a few years, Cmd has recently matured into the cornerstone of Sencha application development. Follow these Steps : 1.  To generate a Workspace, use this command: sencha -sdk /path/to/sdk generate workspace /path/to/workspace eg: sencha -sdk /Rajavk/senchaapi/ext4.2.2 generate workspace /Rajavk/mysenchworkspace 2. Next, generate app: sencha -sdk /path/to/ExtJssdkFolder generate app MyAppName /path/to/workspace/MyAppFolder Eg: sencha -sdk /Rajavk/senchaapi/ext4.2.2 generate app MyFirstApp /Rajavk/mysenchworkspace/myfirstapp 3)  Go to project path and create sample controller through Sencha Cmd. eg: sencha generate controller MyControllerName 4)  Create Model using following command eg: sencha generate model ServerModel name:string 5)  Create sample view using following command (ExtJs Specific. Doesn’t work for touch ) eg: sen