Hey,
I've been using your MVC wrappers for some time and I absolutely love them!
I just migrated a project on which I was using the Telerik Extensions for ASP.NET MVC to use Kendo UI. There have been some problems, but in the end it works like a charm.
I'm just faced with an issue I can't resolve...
On a "Details" page, I have a static, server-bound grid with a column which has a specific EditorTemplate, itself using a Kendo DropDownList.
All my controls use the deferred JS output to keep all the JS clean and at the bottom of the page.
My issue is that the initalization script of the DropDownList is outputted right after the <input> and not at the bottom of the page where I call the DeferredScripts() function.
Let me show you some code that may clear up what I'm trying to explain.
My Models:
My view:
The EditorTemplate associated to the DummyBoolean property:
And that's the outputted HTML:
As you can see, we only have here the DropDownLists' initialization scripts.
The table's is at the bottom of the page where I expect it to be.
Is there anything I'm missing?
Thanks in advance.
Sincerely,
Mickaƫl Derriey
I've been using your MVC wrappers for some time and I absolutely love them!
I just migrated a project on which I was using the Telerik Extensions for ASP.NET MVC to use Kendo UI. There have been some problems, but in the end it works like a charm.
I'm just faced with an issue I can't resolve...
On a "Details" page, I have a static, server-bound grid with a column which has a specific EditorTemplate, itself using a Kendo DropDownList.
All my controls use the deferred JS output to keep all the JS clean and at the bottom of the page.
My issue is that the initalization script of the DropDownList is outputted right after the <input> and not at the bottom of the page where I call the DeferredScripts() function.
Let me show you some code that may clear up what I'm trying to explain.
My Models:
public
class
MyParentViewModel
{
public
IEnumerable<MyChildViewModel> Children
{
get
;
set
;
}
}
public
class
MyChildViewModel
{
public
String DummyString
{
get
;
set
;
}
public
Boolean? DummyBoolean
{
get
;
set
;
}
}
@model MyParentViewModel
@(
Html.Kendo().Grid(Model.Children)
.Name("Children")
.Deferred()
.Columns(c =>
{
c.Bound(x => x.DummyString);
c.Bound(x => x.DummyBoolean);
});
)
@model Boolean
@(
Html.Kendo().DropDownListFor(x => x)
.Deferred()
.Items(items =>
{
items.Add().Selected(value == false).Text("Non").Value(Boolean.FalseString);
items.Add().Selected(value == true).Text("Oui").Value(Boolean.TrueString);
})
.HtmlAttributes(new { style = "width:100px; line-height:normal;" })
)
<
div
class
=
"k-widget k-grid k-secondary"
id
=
"Groupements"
data-role
=
"grid"
>
<
table
role
=
"grid"
>
<
colgroup
>
<
col
style
=
"width:20%"
>
<
col
>
</
colgroup
>
<
thead
class
=
"k-grid-header"
>
<
tr
>
<
th
class
=
"k-header"
data-field
=
"DummyString"
data-title
=
"DummyString"
scope
=
"col"
>
<
span
class
=
"k-link"
>DummyString</
span
>
</
th
>
<
th
class
=
"k-header"
data-field
=
"DummyBoolean"
data-title
=
"DummyBoolean"
scope
=
"col"
>
<
span
class
=
"k-link"
>DummyBoolean</
span
>
</
th
>
</
tr
>
</
thead
>
<
tbody
>
<
tr
>
<
td
>Groupement #1</
td
>
<
td
>
<
input
disabled
=
"disabled"
id
=
"DummyBoolean"
name
=
"DummyBoolean"
style
=
"width:100px; line-height:normal;"
type
=
"text"
value
=
"True"
>
<
script
>
jQuery(function () { jQuery("#DummyBoolean").kendoDropDownList({ "dataSource": [{ "Text": "Non", "Value": "False", "Selected": false }, { "Text": "Oui", "Value": "True", "Selected": true }], "dataTextField": "Text", "dataValueField": "Value" }); });
</
script
>
</
td
>
</
tr
>
<
tr
class
=
"k-alt"
>
<
td
>Groupement #2</
td
>
<
td
>
<
input
disabled
=
"disabled"
id
=
"DummyBoolean"
name
=
"DummyBoolean"
style
=
"width:100px; line-height:normal;"
type
=
"text"
value
=
"True"
>
<
script
>
jQuery(function () { jQuery("#DummyBoolean").kendoDropDownList({ "dataSource": [{ "Text": "Non", "Value": "False", "Selected": false }, { "Text": "Oui", "Value": "True", "Selected": true }], "dataTextField": "Text", "dataValueField": "Value" }); });
</
script
>
</
td
>
</
tr
>
</
tbody
>
</
table
>
</
div
>
The table's is at the bottom of the page where I expect it to be.
Is there anything I'm missing?
Thanks in advance.
Sincerely,
Mickaƫl Derriey