[SalesForce] Dynamically display picklist values based on Record type in vf page

I am having two record type "Record Type 1" and "Record Type 2" on case object. In this two record type we are a having a picklist field call state__c.
In Record Type 1 State__c values are "A,B,D"
In Record Type 2 State__c values are "C,E,F".

I need to display this state__c picklist field value based on the record type in vf page. Kindly anyone give some idea to get the picklist filed values based on the record type in apex.

Best Answer

Kindly follow This Link. I've used this and its working now. Hope this would be useful.
Dont forget to add connection.js in includescript.

<apex:page >
 //use version according to org
    <script src="/soap/ajax/40.0/connection.js" type="text/javascript"></script>
    <script src="/soap/ajax/40.0/apex.js" type="text/javascript"></script>


    <script>
        sforce.connection.sessionId='{!GETSESSIONID()}';
        function init(){
           var result = sforce.connection.describeLayout('Opportunity'); //to do 
           console.log(result); //parse this object to find picklist values for each record type
        }
    </script>

    <body onload="init();">    
    </body>
</apex:page>