如何在jqGrid中使用自定义控件

如何在jqGrid中使用自定义控件,jqgrid,jqgrid-asp.net,Jqgrid,Jqgrid Asp.net,如何在Jqgrid中为字段使用自定义控件。例如,在添加/编辑弹出窗口中,我有一个日期字段,我想使用persionDatePiker,这些设置是如何设置的 谢谢大家,您需要将edittype设置为custom,并提供custom\u元素和custom\u值功能。文档中的示例: <script> function myelem (value, options) { var el = document.createElement("input"); el.type="text";

如何在Jqgrid中为字段使用自定义控件。例如,在添加/编辑弹出窗口中,我有一个日期字段,我想使用persionDatePiker,这些设置是如何设置的


谢谢大家,

您需要将
edittype
设置为
custom
,并提供
custom\u元素
custom\u值
功能。文档中的示例:

<script>
function myelem (value, options) {
  var el = document.createElement("input");
  el.type="text";
  el.value = value;
  return el;
}

function myvalue(elem, operation, value) {
    if(operation === 'get') {
       return $(elem).find("input").val();
    } else if(operation === 'set') {
       $('input',elem).val(value);
    }
}

jQuery("#grid_id").jqGrid({
   colModel: [ 
      {
        name:'price',
        editable:true, 
        edittype:'custom', 
        editoptions:{
            custom_element: myelem, 
            custom_value:myvalue
        }
     },
   //...
   ]
});
</script>

有关详细信息,请参见。

您需要将
edittype
设置为
custom
,并提供
custom\u元素
custom\u值
功能。文档中的示例:

<script>
function myelem (value, options) {
  var el = document.createElement("input");
  el.type="text";
  el.value = value;
  return el;
}

function myvalue(elem, operation, value) {
    if(operation === 'get') {
       return $(elem).find("input").val();
    } else if(operation === 'set') {
       $('input',elem).val(value);
    }
}

jQuery("#grid_id").jqGrid({
   colModel: [ 
      {
        name:'price',
        editable:true, 
        edittype:'custom', 
        editoptions:{
            custom_element: myelem, 
            custom_value:myvalue
        }
     },
   //...
   ]
});
</script>

有关详细信息,请参见。

,我使用jQuery为Persiantolpack编写了一个控件,如何使用它?我使用asp.net。谢谢,我使用jQuery为Persiantolpack编写了一个控件,如何使用它?我使用asp.net。谢谢