I'm implementing Kendo on a site that uses ColdFusion as our server-side language. I'm setting up a template and I have situation where I must use a ColdFusion variable inside the template. For those not familiar w/ ColdFusion, it uses the # to indicate ColdFusion markup - ie. if I wanted the content of a div to be populated from a CF variable, I'd have something like:
<div>#cf_variable#</div>In fact, the example above is pretty much exactly what I'm trying to do, just inside a template:
<script type="text/x-kendo-template" id="tile_template"> <div class="padding list-items-footer k-block"> <button type="button" class="btn btn-success"> <i class="fa-icon-play"></i> <span class="hidden-xs">##APPLICATION.LC.getValue("LaunchButton")##</span> </button> </div></script>APPLICATION.LC is our system for multi-lingual text/labels, which is why it's a requirement.
I initially only had single # on each side of the CF variable, but that gave me a javascript error. Adding the second # to each side (which is how you escape the # in CF), stopped the error, but what's actually being rendered in the button is 'APPLICATION.LC.get value("LaunchButton")', instead of the CF-calculated value. Additionally, trying to escape the hashes using \, as suggested in the template help, (ie.\#APPLICATION.LC.getValue("LaunchButton")\#), also doesn't cause a javascript error, but again, only outputs '#APPLICATION.LC.get value("LaunchButton")#'.
I was able to find this thread (http://www.telerik.com/forums/syntax) where it was suggested that the selector could be changed for the Kendo templating system, but no further information was provided on how.
For ease of updating in the future, I'd prefer if we didn't have to change the selector, but I realize it may be inevitable. Any suggestions/guidance that can be provided would be appreciated.
I have a listview defined as follows:
<div data-role=" listview"
data-template="template"
data-bind="source: people,
visible: isVisible,
events: {
change: onChange
}"
style="float:left; width:100%; height: 370px;display:block;overflow: auto">
</div>
now listview nicely shows my array of items but I need to update another view when the user selects a new row.My VM looks like:
var viewModel = kendo.observable({
isVisible: true,
onChange: function (){
debugger;
var data = dataSource.view(),
selected = $.map(this.select(), function (item) {
return data[$(item).index()].ProductName;
});
kendoConsole.log("Selected: " + selected.length + " item(s), [" + selected.join(", ") + "]");
},
onSave: function (e) {
kendoConsole.log("event :: save(" + kendo.stringify(e.values, null, 4) + ")");
},
person: {
Name:"John Doe"
},
.....
notice the debugger statement in the onChange function , well it is never hit as no idea what happened to the change event. I would have used Angular but
it has a problem that caused us to drop back to MVVM (Knockout). even if I make onChange a global function it does not fire.
Very confused
saveChanges: function (e) { // Turn on progress animation this._progress(true); var that = this; this.dataSource.one("change", function (e) { // Turn off progress animation that._progress(false); });Hello, I would like to show/hide tabs on a grid detail template based on grid value:
do anyone achieved something similar?
Best Regards
<script id="template" type="text/kendo-tmpl">@(Html.Kendo().TabStrip() .Name("tabStrip_#=ID#") .SelectedIndex(0) .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In))) .Items(items => { //if current grid row field #ShowExpected# items.Add().Text("Expected Items").Content(@<text>show a grid containing expected items</text>); //if current grid row field #ShowReceived# items.Add().Text("Received Items").Content(@<text>show a grid containing received items</text>); }) .ToClientTemplate())</script>
