📜  jquery 数据库在数据库网格中添加下拉列表 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:39.927000             🧑  作者: Mango

代码示例1
// static data
 var containerTypes = [
            "45FR",
            "45GPHC",
            "45HC",
            "45REHC"]

//database columns rendering
  {
                        "data" : null,
                              "mRender": function (d, t, r) {
                                var $select = $("", {
                                    "id": r[0] + "start",
                                    "value": d
                                });
                                $.each(containerTypes, function (k, v) {
                                    var $option = $("", {
                                        "text": v,
                                        "value": v
                                    });
                                    if (d === v) {
                                        $option.attr("selected", "selected")
                                    }
                                    $select.append($option);
                                });
                                return $select.prop("outerHTML");
                            }
                     },