YUI Datatable dropdown option value text defination

bulletming發表於2019-06-21
var dt_columns=[
{ key: "check", formatter:"checkbox"},
{ key: "status_name", formatter:"dropdown",dropdownOptions:[{"text":"Connection.Threads_connected","value":"1012"},{"text":"Connection.Threads_running","value":"1013"},{"text":"Fullscan.Select_full_join","value":"1023"},{"text":"Fullscan.Select_full_range_join","value":"1024"}]},
{ key: "start_date", editor:"textbox"},
{ key: "end_date", editor:"textbox"},
{ key: "data_type", formatter:"dropdown",dropdownOptions:["day_sum","day_max","night_sum","night_max"] },
{ key: "Top_N", editor:"textbox" }
];

今天看了一下原始碼知道dropdownOptions分開定義一個option的value和text部分。如紅色部分。
如果想value和text相同,像藍色部分那樣定義就行了。

JS真是靈活。YUI寫的真是不錯


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/82392/viewspace-418914/,如需轉載,請註明出處,否則將追究法律責任。

相關文章