tabalinas / jsgrid

Lightweight Grid jQuery Plugin
http://js-grid.com
MIT License
1.53k stars 353 forks source link

row edit based on conditions #580

Closed koni1225 closed 7 years ago

koni1225 commented 7 years ago

Hi Tabalinas,

Hope u r doing well.

i had a small situation, i need to edit row based on the condition

for example : if id is equals to 1 i need to edit that row other no need to edit.

can you give me some example.

Thanks in advance.

tabalinas commented 7 years ago

Use rowClick handler. The default implementation is the following:

        rowClick: function(args) {
            if(this.editing) {
                this.editItem($(args.event.target).closest("tr"));
            }
        },

Update the condition so that it's not editing for particular items. (you will have an item in args.itam).

koni1225 commented 7 years ago

Hi Tabalinas,

Hope u r doing well.

Thanks for u r reply the example u r given is working perfectly.

but the edit icon is enabled how to disable the edit icon

Thanks in advance.

tabalinas commented 7 years ago

If you are using control field then set editButton: false in the field config.