Friday, 24 February 2017

How to add dynamically store data to combobox

Am going to bind the data to combobox store dynamically. below is the combobox how to define the properties and all.

xtype: 'combobox',
width: '10%',
reference: 'Amount',
fieldLabel: 'Amount',
labelSeparator: "",
labelAlign: 'top',
queryMode: 'local',
store: new Ext.data.JsonStore({
fields: ['id', 'display', 'value']
}),
displayField: 'display',
valueField: 'value',
emptyText: 'Select',
name: 'relationType',
submitEmptyText: false,
allowBlank: false,
style: '141px',
listeners: {
change: 'onSelectionChange'
}



In controllerthe code will be.


var multiplyCombo = fieldsContainer.down('combobox').getStore();
var bulkAddArray = [];
for (var i = 1; i <= multiplyFactor; i++) {
bulkAddArray.push({
display: i,
value: i
});
}
multiplyCombo.loadData(bulkAddArray, true);


Thursday, 23 February 2017

How to call controller method from Html element click

I got idea like i would like to show some forms while am click on HTML label , Calling Extjs viewController from HTML DOM element tried to add click event to fetch the controller but didnt worked that.

Then i realized after rendering that DOM i will add function to that elementt click function. The code will like below.

This is the code of HTML text from JSON object.

<label id='lblShowDep'>Privacy Policy</label>

After rendering adding the controller method to that DOM Element

if(Ext.get('lblShowDep')){
     Ext.get('lblShowDep').on('click', function() {
           controller.onClickShowDep();
      });
}




Sunday, 19 February 2017

ExtJS Close all opend windows

Today i would like to tell  today how to close all windows currently opend in application.

Using  Ext.WindowManager we can get all windows in our app. Using the following code we close all opend windows.


var activeWin = Ext.WindowManager.getActive();
if (activeWin) {
    activeWin.close();
}
 

Sunday, 12 February 2017

responsecode from store callback not coming

Hello Folks,

The callback method does not have the server response passes as object. There are many ways to load the data into the store and not all of them have a server response.

For this we have to override the proxy processResponse function in the store withe operation object contains serverResponse.


    Ext.define('Ext.data.proxy.ServerOverride', {
            override: 'Ext.data.proxy.Server',
            processResponse: function (success, operation, request, response, callback, scope) {
               operation.serverResponse = response;
               this.callParent(arguments);
            }
         });




storeDepartments.getProxy().setUrl(config.CUSTOMER_DEPARTMENTS_URL);
        storeDepartments.load({
        callback: function(records, operation, success, response) {
        if(success == false){
              var response = operation.serverResponse;            
              if(response){
            var responseText = Ext.decode(response.responseText);
if(responseText.status == 404){
 Ext.Msg.alert('Service Unavailable');
}
            }
}
}});



Wednesday, 1 February 2017

Using Angular with Salesforce and Getting started with Elm

  • Fission Labs

    Plot No: 703/A, 3rd Floor, Road No: 36, Jubilee Hills, Hyderabad (map)
  • Join us for a two session meetup on 11th February 2017. We will have the following sessions:
    Using Angular with Salesforce by Shashank Srivatsavaya - 10:30 AM to 11:30 AM
    In this talk, we will see how to integrate Angular/Angular2 applications with salesforce APIs through a sample contact management application hosted on Heroku PaaS. (This talk could be a hands-on based session, we will update soon.) 
    Getting Started with Elm by Khaja Minhajuddin - 11:30 AM to 12:30 PM 
    Elm is a delightful language to build your web apps. It eliminates almost all of your runtime exceptions. In this talk we'll build a two simple web applications using Elm and will understand the Elm ecosystem. 

Wednesday, 30 November 2016

Extjs Grid Selection check model select all By default

Hello,

We need to add the selModel to Grid config selmodel, in afterLayout listener selectAll();




var selModel = Ext.create('Ext.selection.CheckboxModel', {
    checkOnly: true});    

Tuesday, 16 August 2016

How to add clear trigger to textfield


Hello all,

Today i would like to post the basic textfield enhancements in extjs. How to add the Clear trigger icon to textfield.

Below is the code to add triggers to textfield, we can multiple triggers like clear, search icon aswell.

                  {
                        xtype: 'textfield',
                        fieldLabel: 'Search',
                        triggers: {
                            clear: {
                                cls: 'x-form-clear-trigger',
                                handler:function(field) { field.reset(); }
                            }
                        }
                    }


OutPut




Sunday, 14 August 2016

Extjs - How to change style of item in combox

I would like to post the change the color of item in combox.

Recently i worked on changing the color of combobox item based on current year Quarter. This we can do using XTemplate. XTemplate we can do based on conditional operations, math operations we can do.

We need to create style Class for this.

div .comboColor {
    background-color#87CEFA;
    padding-left: 4px;
} 

And ComboBox definition like below.

{
  xtype: 'combobox',
  labelWidth: 70,
  store: AccountingPeriods,
  displayField: 'Description',
  valueField: 'AccountingPeriodId',
  name: 'Period',
  queryMode: 'local',
  fieldLabel: 'Year Periods',
  tpl: Ext.create('Ext.XTemplate',
  '<tpl for=".">',
  '<div class="{[this.getClass(values)]}">{Description}</div>',
  '</tpl>',
    {
        getClass: function (rec) {
              return rec.IsCurrent ? 'x-boundlist-item comboColor' : 'x-boundlist-item';
                               }
    }

  )}


The OutPut result will be.










Wednesday, 3 August 2016

Hyderabad dotnetConf 2016


Hyderabad dotnetConf 2016 Welcomes You!

Microsoft User Group Hyderabad presents Hyderabad dotnetConf 2016. Immerse yourself 
in the world of .NET.
Hyderabad dotnetConf 2016 featuring speakers from the Microsoft Most Valuable
Professionals, .NET Community and Microsoft. Mark your calendar on August 27th.

Learn to develop for web, mobile, desktop, games, services, libraries and more for a variety
of platforms and devices all with .NET! We'll have presentations on .NET Core 
and ASP.NET Core, C#, F#, Roslyn, Visual Studio, Universal Windows Platform (UWP),
 Xamarin, and much more.

Venue:
Microsoft India Development Center
Building 3, Gachibowli, Hyderabad, Telangana 500032, India


Register

For more details and Agenda MUGH


Sunday, 31 July 2016

Difference between renderer and convert

In Extjs everyone has small confusion what is the Difference between renderer and convert.

renderer: renderer is an "Interceptor" method which can be used to transform the data like value, appearence..before it rendered to the browser.

renderer: function (value, metaData, record, rowIndex, colIndex, store, view) {
    // style the cell using the dataIndex of the column
    var headerCt = this.getHeaderContainer(),
        column = headerCt.getHeaderAtIndex(colIndex);

    metaData.tdCls = 'app-' + column.dataIndex;
    return value;
}


It will returns the HTML string.

convert: convert is a function this converts the value provided by the reader into an object that will be stored into the Model.
This function access the rows information inside the store, based on this we can modify the data.



Sunday, 5 June 2016

dotnetConf 2016 is back

Discover the World of .Net 
dotnetConf Virtual event, June 7-9 2016.






The dotnetConf is a free, 3 day virtual event co-organized by the .NET community and Microsoft. Over the course of the three days you’ll have a wide selection of live sessions that feature speakers from the community and .NET product teams. These are the experts in their field and it will be your chance to learn, ask your questions live and get inspired for your next software project.
For more details, check out http://www.dotnetconf.net
WHEN

Wednesday, 1 June 2016

Introducing Microsoft SQL Server 2016 – get your free ebook today

Microsoft SQL Server 2016 arrives today and with it comes the opportunity to deliver breakthrough in-memory performance, unparalleled security, end-to-end mobile BI and advanced analytics. We want you to see for yourself why Microsoft is recognized as an industry leader across the data platform, with Gartner Magic Quadrant leadership in Operational DBMS (ahead of Oracle, IBM, and SAP), BI, and Analytics and Data Warehousing.  
Download this free nine-chapter ebook today to learn from expert authors Stacia Varga, Denny Cherry, and Joseph D’Antoni, who describe the features and enhancements that make this release of SQL Server 2016 the best ever:
  • Mission-Critical Performance: Chapters cover faster queries, better security, higher availability, and the improved database engine.
  • Deeper Insights Across Data: Chapters cover the broader data access, increased analytics, and better reporting in SQL Server 2016. 
  • Hyperscale Cloud: Chapters cover the improvements in Azure SQL Database and how to expand your options with SQL Data Warehouse.



Microsoft SQL Server Team

Saturday, 28 May 2016

.Net sorting list with special characters

Sorting using c# .Net  doesn't use ASCII while sorting, It uses Unicode. When we perform a string sort, .Net by default uses the current culture.

Sorting a list in c# with special characters like "-", "/"

Example:
1.  Here is the Sample Data before sorting.


























We can't get sort String having the special characters, Now we can do with RegExpression.

using System.Text.RegularExpressions;


Ascending

response.Result = response.Result.OrderBy(f => Regex.Replace(f.Name.TrimStart().TrimEnd(), "[^a-zA-Z0-9_]+", " ")).ToList();


Descending

   response.Result = response.Result.OrderByDescending(f => Regex.Replace(f.Name.TrimStart().TrimEnd(), "[^a-zA-Z0-9_]+", " ")).ToList();


Result: