or
data: dsData
});
With the newest nightly builds, this results in a "ghost" item in the DataSource with all undefined values.
Just passing the DataSource an empty array fixes the problem but is what I was doing wrong and is it effectively the same as what I'm now doing?
<div data-title="images" data-role="view" id="index" data-url="/" data-layout="default" data-model="ImageViewModel" data-init="initImageView"> <div id="container"> </div> </div>
now this produces the look that I want (see attached file) with each image side by side and N fit on a row according to the width of container. of course this is more than crude as I am not using the VM but cannot see how to use one of your containers that allow using data-binding and MVVM. All the List want to put each image on its own line. This is pretty easy in Sencha Touch as they have dataview container which u seem to be missing.
Thanks
getByUid: function(id) { var idx, length, data = this._data; for (idx = 0, length = data.length; idx < length; idx++) { if (data[idx].uid == id) { return data[idx]; } }}
watts, hours and how to call the javascript function?
<div data-role="view" id="forms" data-title="Calculadora de Consumo" data-layout="layout" data-transition="slide" data-init="initForm" > <ul data-role="listview" data-style="inset" data-type="group"> <li> Sepa cuánto consumen sus artefactos. <ul> <li> <input type="tel" name="watts" size="5" value="0" />Watts del artefacto </li> <li> <input type="tel" name="hours" size="5" value="0" />Horas de funcionamiento </li> <li> <input type="tel" name="unitcost" size="9" value="105" />Costo KWh </li> <li> <input type="button" value="Calculate" onclick="workitout(this.form)" /> </li> <li> <input type="text" name="daycost" size="7" />Costo diario </li> <li> <input type="text" name="qtrcost" size="7" />Costo mensual </li> <li> <input type="text" name="yrcost" size="7" />Costo anual </li> </ul> </li> </ul></div><script language="JavaScript" type="text/JavaScript"><!--function workitout(form){var kw = form.watts.value / 1000;var hrs = parseInt(form.hours.value);var cost = (form.unitcost.value * kw * hrs) / 100;var annual = cost * 365;var quarter = annual / 12; cost = round(cost);annual = round(annual);annual = round(annual);form.daycost.value = cost;form.qtrcost.value = quarter;form.yrcost.value = annual;}function round (num) {num = Math.round(num * 100) / 100;num = (num + 0.001) + '';return num.substring(0, num.indexOf('.') + 3);} // End --></script>
var vm = kendo.viewModel({ animals: []}); vm.animals.push(new Cat());vm.animals.push(new Dog()); kendo.bind("#farm", vm);<div id="farm"><div data-template="animal-template" data-bind="source: animals"></div></div> Here is where I would define the different templates for each animal