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
    Offline posted in reply to SunilMehta

    Hi, Sunil Mehta.

    First of all I suggest you to read this topic and if you think it's proper, use the approach that is proposed. 

    In your sample you are using AJAX to take the data for the second drop down and I suppose you want to bind that data on the client. As far as I know this is not possible to happen only on the client-side, because the WebDropDown has only server-side data source, and if you want to add a item on the client it also should be added on the server. Even there is a client-side method for adding an item, if you want to use it you will need to add handler for the server-side OnItemAdded event and inside that handler you will need to add this new item to the drop down data source:

    <script type="text/javascript">

        function WebDropDown1_client_SelectionChanged(sender, args) {

            var newItem = sender.get_items().getItem(0);

            sender.get_items().add(newItem);

        }

    </script>

    <ig:WebDropDown ID="WebDropDown1" runat="server" OnItemAdded="WebDropDown1_server_OnItemAdded">

        <ClientEvents SelectionChanged="WebDropDown1_client_SelectionChanged"/>

    </ig:WebDropDown>

    So here you have one other problem. To add a new item to the drop down, it should be from type Infragistics.Web.UI.DropDownItem, which you can hardly create(In the code above, I'm just duplicating the first drop down item). And second - you are using AJAX, but again you need postback to add the new item, which I don't think it's good for the performance. Again I will suggest to to use the approach from the this topic.

    If you want client-side binding you can use igCobmo, but it's part from our jQuery product.

    Best regards,
    Nikolay

Children