<div id="localization_container" class="localization_container"> <input id="localization_dropdownlist" class="localization_dropdownlist"></input> </div><div id="script_references"> <script src="scripts/jquery.min.js" type="text/javascript"></script> <script src="scripts/kendo.all.min.js" type="text/javascript"></script> <script src="scripts/templates.js" type="text/javascript"></script> <script src="scripts/framework.js" type="text/javascript"></script> </div><?xml version="1.0" encoding="utf-8" ?><localization> <language> <display_name>United States (English)</display_name> <local_identifier>us</local_identifier> <culture_info>en-US</culture_info> <image><![CDATA[images/en-US/flag.png]]></image> </language> <language> <display_name>France (French)</display_name> <local_identifier>fr</local_identifier> <culture_info>fr-FR</culture_info> <image><![CDATA[images/fr/flag.png]]></image> </language> <language> <display_name>Sweden (Swedish)</display_name> <local_identifier>se</local_identifier> <culture_info>sv-SE</culture_info> <image><![CDATA[images/se/flag.png]]></image> </language> <language> <display_name>Philippines (Tagalog)</display_name> <local_identifier>ph</local_identifier> <culture_info>en-PH</culture_info> <image><![CDATA[images/en-PH/flag.png]]></image> </language></localization>// === LOCALIZATION DROPDOWNLIST ===var template_localization_dropdownlist = kendo.template('<img src="#=image#" style="width: 16px; height: 11px; border-width: 0px;" /> #=display_name#');$(document).ready(function () { var selected_culture = get_current_culture() if (selected_culture == '') { selected_culture = 'en-US'; } $("#localization_dropdownlist").width(200).kendoDropDownList( { autoBind: false, dataTextField: "display_name", dataValueField: "culture_info", filter: "contains", template: template_localization_dropdownlist, dataSource: { transport: { read: "xml/localization.xml" }, schema: { type: "xml", data: "/localization/language", model: { fields: { display_name: "display_name/text()", local_identifier: "local_identifier/text()", culture_info: "culture_info/text()", image: "image/text()" } } } }, change: function () { this.value(selected_culture); } });});<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" } ] });});