<div id="manGrid" class="col4" style="width: 800px; height: 500px; background-color: Green !important; "></div>
<p>Hello World</p>
<br /><br />
<div id="radGrid" class="col4" style="width: 800px; height: 500px; background-color: Yellow !important; " ></div>
Yields:
<div id="manGrid" class="col4" style="width: 800px; height: 500px; background-color: Green !important; "></div>
<p>Hello World</p>
<br>
<br>
<div id="radGrid" class="col4 k-grid k-widget" style="width: 800px; height: 500px; background-color: Yellow !important; " tabindex="0">
This would be the expected behavior, but the syntax I prefer give me.
Where as:
<div id="manGrid" class="col4" style="width: 800px; height: 500px; background-color: Green !important; " />
<p>Hello World</p>
<br /><br />
<div id="radGrid" class="col4" style="width: 800px; height: 500px; background-color: Yellow !important; " />
Yields:
<div id="manGrid" class="col4" style="width: 800px; height: 500px; background-color: Green !important; ">
<p>Hello World</p>
<br>
<br>
<div id="radGrid" class="col4 k-grid k-widget" style="width: 800px; height: 500px; background-color: Yellow !important; " tabindex="0">
</div>
Both have the same javascript code. The first div is replaced with a template while the second is replaced with a grid. The problem being is the second becomes a child of the first with the <div /> sentax, while they are peers with the <div></div> sentax.
Thanks
Randy
$(document).ready(
function
() {
SetupForm();
// Kendo Combo Box
$(
"#fieldToAdd"
).kendoDropDownList({ index: 0, change: onChange });
function
onChange() {
var
fieldToAdd = $(
"#fieldToAdd"
).data(
"kendoDropDownList"
);
value = fieldToAdd.value();
text = fieldToAdd.text();
if
(value >= 0) AddFieldOnForm(value, text);
fieldToAdd.select(0);
}
}
<
select
id
=
"fieldToAdd"
class
=
"inputfields"
title
=
"test"
style
=
"width: 152;"
>
<
option
value
=
"-1"
style
=
"text-align: center;"
>Add Field</
option
>
<
option
value
=
"5"
>Checkbox</
option
>
<
option
value
=
"9"
>Checklist</
option
>
<
option
value
=
"8"
>File Upload</
option
>
<
option
value
=
"10"
>Label</
option
>
<
option
value
=
"6"
>Multiple Choice</
option
>
<
option
value
=
"7"
>Picklist</
option
>
<
option
value
=
"12"
>CRM Picklist</
option
>
<
option
value
=
"1"
>Text Single-line</
option
>
<
option
value
=
"2"
>Text Multi-line Small</
option
>
<
option
value
=
"3"
>Text Multi-line Medium</
option
>
<
option
value
=
"4"
>Text Multi-line Large</
option
>
<
option
value
=
"11"
>Subscription Management</
option
>
<
option
value
=
"13"
>Star Rating</
option
>
<
option
value
=
"14"
>Image</
option
>
</
select
>
$(document).ready(
function
() {
$(
"#grid"
).kendoGrid({
dataSource: {
transport: {
read: {
url:
"bin/view_inventory.php"
,
dataType:
"json"
}
}
},
height: 250,
scrollable:
true
,
sortable:
true
,
filterable:
true
,
pageable:
true
,
columns: [
{
field:
"id"
,
title:
"ID"
},
{
field:
"type"
,
title:
"Type"
},
{
field:
"name"
,
title:
"Name"
},
{
field:
"descripton"
,
title:
"Description"
},
{
field:
"price"
,
title:
"Price"
},
{
field:
"account"
,
title:
"Account"
}
]
});
});