How to use datasource field value outside template?

1 posts, 0 answers
  1. Deep
    Deep avatar
    1 posts
    Member since:
    Feb 2014

    Posted 20 Mar 2014 Link to this post


    <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??





Back to Top