function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gengen 

how to create dropdown using extjs in visualforce

Hi,

 

Could any one help, How to create dropdown in visualforce using extjs?

 

Thanks....

Avidev9Avidev9
Any reason you want to do this exclusively using extjs ?
Can share more info on this ?
gengen

Hi Avi,

 

In our project we need to develop visualforce with ExtJs....

We need to develop Page with certain fields, In that we have drop downs with dependencies and the drop downs need to populate dynamically (eg: if we select country from one dropdown then related states should be populated in states dropdown).

 

 

Thanks....

Avidev9Avidev9
Well I more of a Jquery guy. But this dependency thing I guess this can be done using only VIsualforce. I have myself done this using plain VF only
gengen

Yes Avi, I have created dependencies fields using VF only.....(Using FieldDependencies).

 

But i am unable to populate the picklist....

 

I am using this in apex class.

 

        List<String> pickListvalues = new List<String>();
        Schema.DescribeFieldResult statusFieldDescriptionforPT =  APPSTD__c.States__c.getDescribe(); 
         for (Schema.Picklistentry picklistEntry: statusFieldDescriptionforPT.getPicklistValues()){
             pickListvalues.add(pickListEntry.getValue());
         }
        
        String JSONString = JSON.serialize(pickListvalues);//This is how we can serailize our response into JSON format
        return '{\"Records\":' +JSONString+', \"error\": \"null\", \"status\":\"SUCCESS\", \"count\":\"' + pickListvalues.size() + '\" }';
    }

 

Avidev9Avidev9

I understand your requirement.

My question is why not Visualforce Components and WHy ext js ?

gengen
As per business requirement need to change the look and feel of VF.
So  currently we started developing all the  pages in ExtJs.
gengen

Yes Avi....

We have created 2dependent pick list using Extjs in VF. And populating the values into picklist using Controller(All the logic to be written in controller) .

we need to add one submit button to save the content into custom object.

 

Plz help

Avidev9Avidev9
You have to send the value back to the controller either by using actionFunction or jsRemoting.
I am sorry I am not extjs guy but I am pretty much into jquery ,have a look at chosen.js. That can make your UI much better.