如何在Kendo网格中显示枚举值使用Angular js?

时间:2015-08-31 06:06:19

标签: angularjs kendo-grid

Everyone.My Question是如何在kendo grid colummn中显示枚举值?

现在我按原样通过了。但我要求减少此代码并使用枚举

 var levelType = function myfunction() {
            NA = 0,`enter code here`
            SpeechRecognition = 1,`enter code here`
            Transcriptionist = 2,
            Review = 3,
            SuperProof = 4,
            PreAudit = 5,
            Formatter = 6,
            PostAudit = 7,
            Customer = 8
        }

直接在kendo网格中提供枚举类型值。我正在使用角度函数所以请回答应该在angularjs。如何减少模板代码并直接将enum的值分配给kendo网格。enter code here

谢谢

1 个答案:

答案 0 :(得分:0)

但我想减少模板和kendo网格的代码显示api值。我想提出一个条件,如果1来自api然后显示一个值对应的枚举类型1.

columns: [
                       {
                           template: "<div class='mdi-device-access-time' id='red-clock'> </div> #=StatType#" + "<label>H</label>",
                           title   : "Type",
           width   : "50"
                       },
                       {
                           template: '#if(Level == "0"){#' +
                                     '<label>MT</label>' +
                                     '#}else if(Level == "1"){#' +
                                     '<label>SpeechRecognition</label>' +
                                     '#}else if(Level == "2"){#' +
                                     '<label>Transcriptionist</label>' +
                                     '#}else if(Level == "3"){#' +
                                     '<label>Review</label>' +
                                     '#}else if(Level == "4"){#' +
                                     '<label>SuperProof</label>' +
                                     '#}else if(Level == "5"){#' +
                                     '<label>PreAudit</label>' +
                                     '#}else if(Level == "6"){#' +
                                     '<label>Formatter</label>' +
                                     '#}else if(Level == "7"){#' +
                                     '<label>PostAudit</label>' +
                                     '#}else if(Level == "8"){#' +
                                     '<label>Customer</label>' +
                                     '#}else {#' +
                                     '<label>NA</label>' +
                                     '#}#',
                           title: "Level",

                       }

var levelType = function myfunction(){             NA = 0,enter code here             SpeechRecognition = 1,enter code here             转录师= 2,             评论= 3,             SuperProof = 4,             PreAudit = 5,             Formatter = 6,             PostAudit = 7,             客户= 8         }