3

I am using struts2 jquery grid. It has 2 formatters email & sms. It has a select with 2 options active or inactive. The user can change from active to inactive & vice versa. So basically i have to save both the columns value in the database.

<sjg:gridColumn name="eMail" index="eMail" 
                 title="Mail Alert" editable="true"
                 sortable="true" formatter="Mail"/>

formatter

function Mail(value, options, rowObject){
    var option = {"Inactive": "Inactive","Active":"Active"};
    var radioHtml = '<select>';
    $.each(option, function(key, val){
        radioHtml+='<option value="'+key+'"'+(key==value?' selected="selected"':'')+'>'+val+'</option>';
    });
    radioHtml+='</select>';
    return radioHtml;
}

And same for sms.

Can anyone help me how to go about it. Thanks in advance.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Pradnya
  • 649
  • 2
  • 6
  • 17

0 Answers0