hi
I have listView that bind to service that returns array of Product
Product Is { ProductId : 1 , ProductName : 'laptop' , Size : 1 , Quantity : 1000 }
i'm using the template like this:
Is it possible to pass the data to a function ?
i also try this:
<div class="ProdNameClass" onclick="EditProductDataObject( # data #);">
click to run EditProductDataObject function
</div>
but this calls the function with undefined
Thanks for any help
moti
I have listView that bind to service that returns array of Product
Product Is { ProductId : 1 , ProductName : 'laptop' , Size : 1 , Quantity : 1000 }
i'm using the template like this:
<script type="text/x-kendo-tmpl" id="MyTemplate"> <div class="ProdNameClass"> ${ProductName} </div> <div class="ProdClass" onclick="EditProduct(${ProductId});"> click to run EditProduct function // this works </div> <div class="ProdClass" onclick="EditProductDataObject(${data});"> click to run EditProductDataObject function // this is not working, i'm getting nothing when i'm click </div> < /script>function EditProduct(id){ // do something.... // this works fine..... } function EditProductDataObject(dataObject){ // this function need to get the Whole Object // so i can do: var id = dataObject.ProductId; // do something... }Is it possible to pass the data to a function ?
i also try this:
<div class="ProdNameClass" onclick="EditProductDataObject( # data #);">
click to run EditProductDataObject function
</div>
but this calls the function with undefined
Thanks for any help
moti