This is a migrated thread and some comments may be shown as answers.

Advanced Form with JS, problem !

1 Answer 48 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sanchez
Top achievements
Rank 1
Sanchez asked on 02 Apr 2012, 02:27 PM
Hi,
Here my function
function SelectedIndexChangedHandler(sender, args) {
    var $ = $telerik.$;
    if (args.get_item().get_value() == "NULL") {
        var ResourceComboBox = $find($("[id$='Form_ResActivites']").attr("id"));
        //var emptyItem = ResourceComboBox.findItemByText("Consultation");
        var items = ResourceComboBox.get_items();
        items.getItem(2).select();
    }
}
 I try de set a selected default value to my combo box resource when i add a new appointement
 (startInsertingInAdvancedForm="true"),
It don't work.
I'm in WebService binding mode, what is wrong in my code ??? thanks

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 03 Apr 2012, 11:33 AM
Hi Sanchez,

 
In WebService when such functionality is implemented we recommend finding the resource combobox more precisely depending if it is in the insert or update form because both of them are rendered. Here is a sample code that should be used in the edit form:

var ResourceComboBox = $find($("[id$='AdvancedEditForm_ResActivites']").attr("id"));

Similar functionality is explained with date pickers in the Using javascript/jQuery and CSS help topic in the Web Service Binding part of the Change end date/time automatically when start date/time changes section.

Hope this will be helpful.

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Sanchez
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or