Hi,
MVC controls helpers generated html, then on the end with ScriptRegistrar applied javascript to those elements. Now you are rendering script just after the element, so if I have 100 controls on page, 100 script "oneliners" would appear in generated html(both examples below).
Question is why change helpers behaviour(except initializanig control properties through jquery)?
old way:
new way
MVC controls helpers generated html, then on the end with ScriptRegistrar applied javascript to those elements. Now you are rendering script just after the element, so if I have 100 controls on page, 100 script "oneliners" would appear in generated html(both examples below).
Question is why change helpers behaviour(except initializanig control properties through jquery)?
old way:
<
div
class
=
"t-widget t-dropdown t-header"
style
=
"width:100%;"
tabindex
=
"0"
><
div
class
=
"t-dropdown-wrap t-state-default"
><
span
class
=
"t-input"
>Value</
span
><
span
class
=
"t-select"
><
span
class
=
"t-icon t-arrow-down"
>select</
span
></
span
></
div
><
input
id
=
"someField"
name
=
"someField"
style
=
"display:none"
type
=
"text"
value
=
"0"
></
div
>
//scripts are applied on the end with ScriptRegistrar, so clean html, no matter how much controls
new way
<
span
style
=
""
class
=
"k-widget k-combobox k-header"
><
span
unselectable
=
"on"
class
=
"k-dropdown-wrap k-state-default"
><
input
class
=
"k-input"
type
=
"text"
autocomplete
=
"off"
tabindex
=
"0"
style
=
"width: 100%; "
><
span
unselectable
=
"on"
class
=
"k-select"
><
span
unselectable
=
"on"
class
=
"k-icon k-arrow-down"
>select</
span
></
span
></
span
><
input
id
=
"someField"
name
=
"someField"
data-role
=
"combobox"
style
=
"display: none; "
></
span
><
br
><
br
><
script
><
br
><
span
class
=
"Apple-tab-span"
style
=
"white-space:pre"
> </
span
>
//this part bothers me, with each control I get this in html
<script>jQuery(function(){jQuery("\#someField").kendoComboBox({});});
</
script
>