ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: kshipra on March 04, 2017, 01:08:46 am

Title: Render readonly rows by default
Post by: kshipra on March 04, 2017, 01:08:46 am
how can i render in grid on first time load , the whole row as readonly?

right now I pasted same callback function for each column in row to make entire row readonly. Is there more cleaner and efficient way to do this?

e.g.
{
                title: "Definition",
                editor: { type: 'textarea', attr: 'rows=5' },
                width: 350,
                dataIndx: "Definition",
                filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'] },
                editable: function (ui) {
                    if (ui.rowData['IsBaseEvent'] === true) {
                        return false;
                    } else {
                        return true;
                    }
                }
            },
            {
                title: "Notes",
                editor: { type: 'textarea', attr: 'rows=5' },
                width: 350,
                dataIndx: "Notes",
                filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'] },
                editable: function (ui) {
                    if (ui.rowData['IsBaseEvent'] === true) {
                        return false;
                    } else {
                        return true;
                    }
                }
            }
Title: Re: Render readonly rows by default
Post by: paramvir on March 08, 2017, 12:15:18 am
There is no need to specify editable for every column.

There is a global editable option for rows. https://paramquery.com/pro/api#option-editable

Code: [Select]
editable: function (ui) {
                    if (ui.rowData['IsBaseEvent'] === true) {
                        return false;
                    } else {
                        return true;
                    }
                }