The use of conditional judgment in template in Kendoui control Kendogrid

Source: Internet
Author: User

The page effects rendered according to the values provided in DataSource are as follows:

The last column of operations, depending on whether it has been processed to show the "Recycle" action button.

The relevant code is mainly the way in which the conditional judgment statement is used in the template:

var Kendogridpermissionapplys = $ ("#kendo_grid_permission_applys"). Kendogrid ({datasource:{data:<?php Ech o $test;?                Sortable:true, Scrollable:false, Selectable:true, pageable:{messages:{ Display: "<?php echo yii::t (' Default ', ' Showing {0}-{1} ' from {2} data items ');?>", EMP Ty: "<?php echo yii::t (' Default ', ' No items to display ');?>", First: "<?php echo yii::t (' default ') , ' Go to the first page ');?> ", Previous:" <?php echo yii::t (' Default ', ' Go to the previous page '); ?> ", Next:" <?php echo yii::t (' Default ', ' Go to the next page ');?> ", Last:" <?p                 HP echo yii::t (' Default ', ' Go to the last page ');?> "}}, columns:[{            Field: "Apply_from", Title: "<?php echo yii::t (' Default ', ' Apply from ');?>"},          {      Field: "Apply_contents", Title: "<?php echo yii::t (' Default ', ' Apply contents ');?>" }, {field: "Apply_status", Title: "<?php echo yii::t (' Default ', ' Apply status ' );?> "}, {field:" Apply_create_time ", Title:" <?php Echo yii::t (' Default ', ' Apply Create time ');?> "}, {Template:" <a class= ' K-butto N ' href= ' index.php?r=apply/admin/showapply&apply_id=#=apply_id#&apply_from=#=apply_from# ' style= ' Min-width:24px ' > View </a><a class= ' K-button ' style= ' min-width:24px ' onclick= ' ifgotodistributepermission ( #=apply_id#, #=apply_status_en#) ' > Assign </a> ' + ' # if (apply_status_en = = 2) {# "+" <a class= ' k-but Ton ' onclick= ' recyclepermission (#=apply_id#) ' > Recycle </a> "+" #} # ", Title:" <?php Echo yii::t (' Defa    Ult ', ' Operate ');?> "}]}). Data ("Kendogrid"); 


The use of conditional judgment in template in Kendoui control Kendogrid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.