English 中文(简体)
jqGrid:始终显示有选择的单列
原标题:jqGrid: Editable column that always shows a select

在jqgrid中,是否有使用像这一col形例子中那样的某种选择的旋转栏:

{ 
name:  Options , 
index:  Options , 
width: 150, 
align:  left , 
resizable: false,
editable: true, 
edittype:  select , 
editoptions: { 
    value: function() { return buildSelect(); } 
},
formatter:  select 
}

但总是显示选择?

我在检查箱之前就这样做了,但似乎没有办法用挑选器做。 理想的情况是,我喜欢以手机方式工作。 任何想法?

最佳回答

所有这些都是可能的。 我确信,你想要的是最好的方法。 在我建议采用某种标准方法的大多数情况下,你们的生活将更加容易,特别是在你们使用的新控制版本之后。

然而,你可以使用习惯格式(见。 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter 而不是<代码>formatter: 选择,显示你喜欢的栏目。 例如,

{ name:  Options , width: 150, align:  left , editable: true, edittype:  select ,
  editoptions: { 
    value: function() { return buildSelect(); } 
  },
  formatter: function (cellvalue, options, rowObject, action) {
    if (cellvalue ===  Yes ) {
      return  <select><option value="1" selected="selected">Yes</option>  +
                      <option value="0">No</option></select> ;
    } else {
      return  <select><option value="1">Yes</option>  +
                     <option value="0" selected="selected">No</option></select> ;
    }
  }
}

可使用<条码>代号<>代号/代码>,但不得使用任何数值代替缺损现值(是或无)。 您也可对<代码>change处理select要素的某些职能具有约束力。

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签