문제

I am using the inline edit option of Jqgrid and want to add a required select box. The first entry should be "please select" and if the user does not choose any other option than "please select" the grid should consider this field as missing and display the build-in "required field is missing" error message.

This is my definition of the select box so far:

 {
    name: 'selectbox',
    index: 'selectbox',
    width: 100,
    editable: true,
    required: true,
    edittype: 'select',
    formatter:'select',
    editoptions:{
     value: {1:"Pony", 2:"Ronny"}

}

My assumption is that I have to add an option without a value at the beginning of the options block like

<option>please select</option>

Yet I did not managed to do that and I am not sure if this is the right approach at all.

도움이 되었습니까?

해결책

just use <select><option value=''>Please Select</option></select>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top