or
(function ($) {
$.printJSON = function(value){
return JSON.stringify(value, undefined, 2);
}
})(jQuery);
var viewModel = kendo.observable({
// other fields etc
update: function (e) {
e.preventDefault();
$("#json_result").html($.printJSON(this));
}
});
<
div
style
=
"width: 400px; float: left; padding-left: 15px;"
>
<
button
data-bind
=
"click: update"
value
=
"Update"
>Update</
button
>
<
pre
id
=
"json_result"
>
</
pre
>
</
div
>
<script type="text/x-kendo-template" id="notificationListTemplate">
<a class="faqListQuestion" href="${url}" data-rel="external" >${title}<br /><span class="notificationDates">${date}</span></a>
</script>
Is there something wrong with my template or some other workaround for this issue?@(Html.Kendo().MultiSelect()
.Name(
"Fields"
)
.DataTextField(
"Name"
)
.DataValueField(
"Id"
)
.Value(ViewData[
"tagslist"
]
as
IEnumerable<
int
>)
.Filter(FilterType.Contains)
.Placeholder(
"..."
)
.Events(e =>
{
e.Change(
"change_field"
);
})
.DataSource(source => {
source.Read(read =>
{
read.Action(
"ShowFields"
,
"Folders"
);
});
})
<div id=
"tree"
>
@(
Html.Kendo().TreeView()
.Name(
"treeview"
)
.ExpandAll(
true
)
.TemplateId(
"treeview-template"
)
.DragAndDrop(
true
)
.BindTo(Model)
.Events(events => events
.DragEnd(
"onDragEnd"
)
)
)
</div>
public
ActionResult Index(IEnumerable<
int
> fieldTags,
int
id = 1 )
{
IEnumerable<TreeViewItemModel> kendoModel =
new
List<TreeViewItemModel>();
SopFolder kendoStartFolder = db.SopFolders.Where(r => r.Id == id).Take(1).Select(r => r).ToList()[0];
kendoModel = CreateKendoTree(kendoStartFolder, fieldTags);
var SopFields =
db.SopFields
.Select(r =>
new
{
Value = r.Id,
Text = r.Name
});
List<
int
> tagslist =
new
List<
int
>();
foreach
(var tag
in
SopFields)
{
tagslist.Add(tag.Value);
}
ViewData[
"tagslist"
] = tagslist;
if
(Request.IsAjaxRequest())
{
return
PartialView(
"_Tree"
, kendoModel);
}
return
View(kendoModel);
}
$(
'#lookupDataGrid'
).data(
'kendoGrid'
).dataSource.transport.read.data ={
"UserLookupTableID"
:123};
console.log($(
'#lookupDataGrid'
).data(
'kendoGrid'
).dataSource.transport.read.data);
// outputs correct object
$(
'#lookupDataGrid'
).data(
'kendoGrid'
).dataSource.read();
var
url = '.../lookup-tables/get-lookup-data?UserLookupTableID=123;
$(
'#lookupDataGrid'
).data(
'kendoGrid'
).dataSource.transport.read.url = url;
$(
'#lookupDataGrid'
).data(
'kendoGrid'
).dataSource.read();
{
"Id": null,
"Name": "Test Item",
"Prototypes": [
{
"Id": "items/prototypes/shield",
"Name": "Shield",
"Mutations": [
{
"Name": "Shield",
"Measurement": 4,
"Statistic": {
"Id": "statistics/damage-reduction-physical",
"Name": "Damage Reduction/Physical"
}
},
{
"Name": "Shield",
"Measurement": 15,
"Statistic": {
"Id": "statistics/health",
"Name": "Health"
}
}
],
"Consumable": false,
"Equipable": true,
"Tags": [
{
"Id": "tags/shielding",
"Name": "Shielding",
"Description": "This is capable of somehow shielding the user, either with mitigation or abilities"
}
]
}
]
}
<
div
data-role
=
"listview"
style
=
"margin: 0px;"
data-template
=
"templates-admin-inherited-prototypes"
data-bind
=
"source: Prototypes"
></
div
>
<
script
type
=
"text/html"
id
=
"templates-admin-inherited-prototypes"
>
<
h2
data-bind
=
"text: Name"
></
h2
>
<
div
data-template
=
"templates-admin-inherited-mutation"
data-bind
=
"source: Mutations"
></
div
>
</
script
>
<
script
type
=
"text/html"
id
=
"templates-admin-inherited-mutation"
>
${ Statistic.Name }
</
script
>