This is a migrated thread and some comments may be shown as answers.

How to use datasource field value outside template?

0 Answers 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Deep
Top achievements
Rank 1
Deep asked on 20 Mar 2014, 12:22 PM

<ul id="vendor-details-data"  data-role="listview"></ul>
         
var vendor_data = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "http://abc.com/index.php?route=api/vendor/getVendorDetails&vendor_id="+vendor_id,
                    dataType: "json"
                }
            },

  });

       $("#vendor-details-data").kendoMobileListView({
           dataSource: vendor_data,
           template: $("#mobile-listview-filtering-vendor-details").text(),
       });


<script type="text/x-kendo-tmpl" id="mobile-listview-filtering-vendor-details">


   <div>
    <ul data-role="listview">       
       <li><img class="pullImage" src="#:image#" alt=""/><h2>#:vendor_name#</h2></li>
       <li> 
       <h4><i class="fa fa-map-marker fa-lg icon-small"></i>Address:</h4>
       <div class="info">
        #:address#
       </div>
       </li>
       
       <li>
       <h4><i class="fa fa-asterisk fa-lg icon-small"></i>Speciality:</h4>
       <div class="info">
        #:speciality#
       </div>
       </li>
       
       <li>
       <h4>Contact:<a class="info1"><i class="fa fa-phone-square icon-small"></i>#:contact#</a></h4>                       
       </li>
       
       <li>
        <h4>Total Likes:<a class="info1"><i class="fa fa-thumbs-up fa-white icon-small"></i>#:like_count#</a></h4>                
       </li>
       
       <li>
       <h4>Total Visit:<a class="info1"><i class="fa fa-map-marker fa-lg icon-small"></i>#:visit_count#</a></h4>          
       </li>
       
       <li>
        <h4>Total Favorite:<a class="info1"><i class="fa fa-star fa fa-white icon-small"></i>#:favorite_count#</a></h4>                        
       </li>
       </ul>  
   </div>
</script>

now how can i use all these vendor details outside template?? Is it possible?? 
And How to Check for condition outside template?  i know how to do it inside template but can we do that in body section??





Tags
General Discussions
Asked by
Deep
Top achievements
Rank 1
Share this question
or