5
有沒有辦法創建具有多個輸入元素的自定義字段?我正在諮詢documentation,創建單個輸入元素非常簡單,但我不確定如何添加多個元素。在自定義編輯類型字段中添加多個輸入元素
有沒有人過過這座橋?如果是這樣,你是怎麼做到的?
下面是一些示例代碼:
...
{name: 'Dimensions', index: 'Dimensions', hidden: true, editable: true,
edittype: 'custom', editoptions: {custom_element: dimensionsElement,
custom_value: dimensionsValue}, editrules: {edithidden: true}},
...
function dimensionsElement(value, options) {
var el = document.createElement("input");
el.type = "text";
el.value = value;
return el;
}
function dimensionsValue(elem) {
return $(elem).val();
}