sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve
asked on 06 Feb 2014, 09:11 PM
This is what I'm trying...
However its throwing an error
Error: Syntax error, unrecognized expression: ##: data.FullPath #
??
<
select
data-value-field
=
"Id"
multiple
=
"multiple"
data-placeholder
=
"Select Category..."
data-text-field
=
"Title"
data-item-template
=
"#: data.FullPath #"
data-role
=
"multiselect"
data-type
=
"HierarchicalTaxa"
>
However its throwing an error
Error: Syntax error, unrecognized expression: ##: data.FullPath #
??
5 Answers, 1 is accepted
0
Accepted
Hello Steve,
Specifying a template as a data attribute is not supported. You will need to set a template ID instead of defining the inline template directly. Check this jsBin demo for more information.
Regards,
Georgi Krustev
Telerik
Specifying a template as a data attribute is not supported. You will need to set a template ID instead of defining the inline template directly. Check this jsBin demo for more information.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 07 Feb 2014, 02:48 PM
Ahhh, okay
Hey can I ask another quick one along the same line?
This is how I'm forming the <select> in the backend. The problem is I need all of the properties in this query to be available in the template...is it doable at all with this method?
categoriesDropDown.DataSource = transformedCategories.OrderBy(x => x.FullPath);
categoriesDropDown.ID = this.PropertyName;
categoriesDropDown.DataTextField = "Title";
categoriesDropDown.DataValueField = "Id";
categoriesDropDown.Attributes.Add("multiple", "multiple");
categoriesDropDown.Attributes.Add("data-type", "HierarchicalTaxa");
categoriesDropDown.Attributes.Add("data-role", "multiselect");
categoriesDropDown.Attributes.Add("data-text-field", "Title");
categoriesDropDown.Attributes.Add("data-value-field", "Id");
categoriesDropDown.Attributes.Add("data-item-template", "category-item-template");
categoriesDropDown.Attributes.Add("data-placeholder", "Select {0}...".Arrange(this.PropertyName));
categoriesDropDown.DataBind();
Hey can I ask another quick one along the same line?
This is how I'm forming the <select> in the backend. The problem is I need all of the properties in this query to be available in the template...is it doable at all with this method?
categoriesDropDown.DataSource = transformedCategories.OrderBy(x => x.FullPath);
categoriesDropDown.ID = this.PropertyName;
categoriesDropDown.DataTextField = "Title";
categoriesDropDown.DataValueField = "Id";
categoriesDropDown.Attributes.Add("multiple", "multiple");
categoriesDropDown.Attributes.Add("data-type", "HierarchicalTaxa");
categoriesDropDown.Attributes.Add("data-role", "multiselect");
categoriesDropDown.Attributes.Add("data-text-field", "Title");
categoriesDropDown.Attributes.Add("data-value-field", "Id");
categoriesDropDown.Attributes.Add("data-item-template", "category-item-template");
categoriesDropDown.Attributes.Add("data-placeholder", "Select {0}...".Arrange(this.PropertyName));
categoriesDropDown.DataBind();
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 07 Feb 2014, 02:52 PM
nm, got it :D
categoriesDropDown.Attributes.Add("data-source", ServiceStack.Text.JsonSerializer.SerializeToString(transformedCategories.OrderBy(x => x.FullPath)));
categoriesDropDown.Attributes.Add("data-source", ServiceStack.Text.JsonSerializer.SerializeToString(transformedCategories.OrderBy(x => x.FullPath)));
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 07 Feb 2014, 04:09 PM
Crap...hey Georgi, the problem with this method for me is on postback the previous selection is wiped out
...any suggestions?
When it was bound with the DS the viewstate restored the selection
...any suggestions?
When it was bound with the DS the viewstate restored the selection
0
Hello Steve,
I am not exactly sure where could be the problem. It will be very helpful if you can send us a simple test project, which replicates the issue. Thus I will be able to review the current implementation and advice you further.
Regards,
Georgi Krustev
Telerik
I am not exactly sure where could be the problem. It will be very helpful if you can send us a simple test project, which replicates the issue. Thus I will be able to review the current implementation and advice you further.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!