Kendo template.

var template = kendo.template($("#singleItem").html());

var result = template(data);

$("#container").append(result);
<script type="text/x-kendo-template" id="singleItem">

# for (var i=0,len=data.length; i< len;i++){ var resultSegItem = data[i].goSegmentsStr; resultSegItem = resultSegItem.replace(/\"/g,"\'"); #

    <tr>

        <td><i class="manyCon"  data-list="#=resultSegItem#"></i></td>

        <td><span class="fontStyle-size14">#=data[i].departDate #</span></td>

    </tr>

#}#

</script>
$(".manyCon").kendoTooltip({

        position:"bottom", //left right top

        wrapperClass:"lineWeight",

        width:370,

        content:kendo.template($("#manyCon").html()),

        callout:false,

        offsetY:10

});
<script type="text/x-kendo-template" id="manyCon">

     # var list = eval( '('+ target.data('list') + ')' ); #

     # for (var i=1,len=list.length;i<len;i++ ) { #

          <span class="tran_air" style="min-width:319px;">

              #= list[i].departCity

          </span>

     #}#

</script>

 

你可能感兴趣的:(template)