or
<
div
id
=
"example"
class
=
"k-content"
>
<
div
id
=
"organizer"
>
<
ul
id
=
"panelbar"
>
<
li
class
=
"k-state-active"
>
<
span
class
=
"k-link k-state-selected"
>producto 1</
span
>
<
div
id
=
"example"
class
=
"k-content"
>
<
div
id
=
"rowSelection"
style
=
"width:620px; height:300px"
></
div
>
<
script
>
$(document).ready(function() {
$("#rowSelection").kendoGrid({
dataSource: {
data: FuncionDellenado(),
},
selectable: "multiple",
pageable: true,
scrollable: true,
navigatable: true,
columns: [
{ field: "FirstName", title: "productos", format: "{0:c}", type:"String",editable: false, width: "150px" },
{ field: "City", title: "cantidad", editable:true, type:"Number", validation: { min: 1, required: true },width: "80px" },
{field: "BirthDate", title: "fecha de Entrega",type:"String",editable:true,width:"100px"},
{ field: "Favoritos", template: "#= kendo.toString(\'<
label
\class=\"label_radio\"for=\"radio-01\">\<
input
name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\"/>\.\</
label
>\')##= kendo.toString(\'<
label
\class=\"label_radio\" for=\"radio-01\">\<
input
name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </
label
>\') ##= kendo.toString(\'<
label
\class=\"label_radio\" for=\"radio-01\">\<
input
name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </
label
>\') ##= kendo.toString(\'<
label
\class=\"label_radio\" for=\"radio-01\">\<
input
name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </
label
>\') ##= kendo.toString(\'<
label
\class=\"label_radio\" for=\"radio-01\">\<
input
name=\"sample-radio\" id=\"radio-01\" value=\"1\" type=\"radio\" />\.\ </
label
>\') #", title: "Favoritos", width: "80px" },
{ field: "añadir", template: "#= kendo.toString(\'<
input
type
=
IMAGE
SRC=\"add.gif\"\id=\"añadir\" value=\"CODE\" />\') #", title: "añadir", width: "210px" }
],
editable: true
});
$('#añadir').click(function () {
var sourcegrid = $('#rowSelection').data('kendoGrid'); //SOURCE GRID
var destinationgrid = $('#Selection').data('kendoGrid'); // DESTINATION GRID
sourcegrid.select().each(function () {
var dataItem = sourcegrid.dataItem($(this));
var column = dataItem.FirstName; // whatever the name of the unique id for your data source
destinationgrid.dataSource.add(dataItem); // DESTINATION DATASOURCE
});
destinationgrid.refresh(); // MUST REFRESH THE DESTINATION GRID
});
});
</
script
>
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>