Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1410
using $find with webdropdown
posted

Hi,

I downloaded trial version of Webdropdown version:11.2.20112.1019 and started using that in my application to see whether it functions properly. If it works well, I can go ahead to buy paid license for this control.

It has been around 45 days I downloaded the control and now I am able to see one issue suddenly.

When  I use $find("webdropdowninstance"), it retrieves NULL.

Is it because the trial version might have expired or there is some other issue. Please let me know.

Parents Reply
  • 4315
    Verified Answer
    Offline posted in reply to SunilMehta

    Hi, Sunil Mehta.

    Here you can find the list of all WebDropDown client-side events. All of them accept 2 parameters: sender, which is reference to the WebDropDown client-side object; args - specific arguments for all the events. In this list you can find the different types of event arguments. The other option is if you have IntelliSence in your Visual Studio, it will show you all the possible values for the client-side events and you don't need the help.

    In the second of your posts, the items that are in bold, I suppose are the values of any drop down item. So you can take them using the following code:

    function wdd_Initialize(sender, args) {

        // use this line of code if you are inside WDD client-side event handler.

        var wddObject = sender;

     

        // use this line of code if you are referencing the WDD from exteranl function.

        // var wddObject = $find("<%=wdd.ClientID %>");

     

        // get the value of the first item - "0901|0"

        value0 = wddObject.get_items().getItem(0).get_value();

     

        // get the text of the first item "ADR"

        text0 = wddObject.get_items().getItem(0).get_text();

    }

    I have also one other suggestions for you. When you want to understand what methods are supported by the client-side WDD object, just put a breakpoint in you browser at the wddObject variable. Then, at runtime, you can inspect all the properties and methods of the control and find the most appropriate for you. This is what I'm doing. So finally if you want to focus on an element you need again to use the JavaScript method focus(). You just need to know which element you want to focus and to find it using the WDD client API. If it's the whole drop down I suppose it will be fine to use wddObject.focus(). But you need to investigate and check this.

    Best regards,
    Nikolay

Children