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

$(document).ready -->> $(':input').change( function ) ... not fireing when comoboBox selection is changed

1 Answer 51 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Efren
Top achievements
Rank 1
Efren asked on 09 Oct 2014, 02:48 PM
Hi Telerik,

I have a problem where I set all 'input' to call a javascript function from my $(document).ready (as you can see below). The problem is that:

$(':input, textarea, select').not(".rgFilterBox, .RadGrid, .rgPagerTextBox").change

is not fired when I go to my comoboBox and select a different index. ( code for radbox below). Yes I have a "OnClientSelectedIndexChanged"
on the control, but I don't want to use that property in this case. I want to use the one from $(document).ready. 

Is there a way to pick up the selected index change from $(document).ready? 

------------------------------------------code here --------------------------------------------
$(document).ready(function () {

    $(':input, textarea, select').not(".rgFilterBox, .RadGrid, .rgPagerTextBox").change(function () {
        setIsDirtyFlag();
    });

});

<telerik:RadComboBox ID="RadComboBoxClearance" runat="server" TabIndex="9" MaxHeight="100" OnClientSelectedIndexChanged="setIsDirtySARFlag"
 Width="215px" EmptyMessage="Select..." MarkFirstMatch="true" Filter="StartsWith"
 RenderMode="Auto">
</telerik:RadComboBox>


1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 13 Oct 2014, 02:42 PM
Hello,

I would like to clarify that we use jQuery in our controls and we include jQuery library on the page when the RadComboBox control is used on that page. See more information here.

Since you have a RadComboBox on the page you can use the jQuery library. There is a trick though - the jQuery object is available as $telerik.$ instead of the default $ or jQuery aliases. This is so to avoid compatibility issues with applications which already use (other versions of) jQuery. For more info you can check the documentation of the noConflict method.

Please refer to the code snippet below:
<script type="text/javascript">
    $telerik.$(document).ready(function () {
        $telerik.$(':input, textarea, select').not(".rgFilterBox, .RadGrid, .rgPagerTextBox").change(function () {
            alert(1);
        });
    });
</script>
<div>
    <telerik:RadComboBox ID="RadComboBoxClearance" runat="server" TabIndex="9" MaxHeight="100"
        Width="215px" EmptyMessage="Select..." MarkFirstMatch="true" Filter="StartsWith"
        RenderMode="Auto">
    </telerik:RadComboBox>
</div>


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ComboBox
Asked by
Efren
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or