One can't so easy to replace <div>
used in formatter: "action"
to a link (<a>
). I think you have to use custom formatter to implement the requirements. I recommend you to look at the demo from the answer. I think that you can implement in close way your requirements.
jqgrid formatter 'actions' - change edit button style
Question
I am using a jqgrid with formatter 'actions', to display an 'edit' button on every row. It works well, but now I would like to display an 'Update' link instead of displaying the default edit button. Is that possible?
My colModel looks something like:
colModel: [
{ name: 'Listname', formatter: displayListName, width: 270, sortable: false },
{ name: 'OrigListname', hidden: true, editable: true, editrules: {edithidden:true} },
{ name: 'NumOfContacts', hidden: true },
{ name: 'IsPrivate', hidden: true, editable: true, editrules: { edithidden: true }, edittype: 'checkbox' },
{ name: 'CanUpdate', hidden: true },
{ name: 'Recipients', formatter: displayRecipients, width: 100, sortable: false },
{ name: 'Update', formatter: 'actions', width: 100, sortable: false,
formatoptions:{
keys: true,
editbutton: true,
editformbutton: true,
delbutton: false,
editOptions: {
closeOnEscape: true,
closeAfterAdd: true,
viewPagerButtons: false,
closeAfterEdit: true,
afterSubmit: function (response, postdata) {
var r = $.parseJSON(response.responseText);
return [r.success, r.Description, null];
}
};
}
},
{ name: 'Import', formatter: displayImport, width: 100, sortable: false },
{ name: 'Export', formatter: displayExport, width: 100, sortable: false }
]
Thank you in advance, Keren.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow