270
Views
5
Comments
Solved
[OutSystems Data Grid Web] DataGrid edit control (CheckBox does not work)
Question
outsystems-data-grid-web
Web icon
Forge asset by OutSystems

Hi,

I want to make the text item editable or non-editable and dynamically control it by turning on / off the check box.


GridContainer AdvancedFormat

onBeginningEdit: addCheckEditable

And the script was generated as follows.


// Called when entering edit mode

 addCheckEditable = function (e) {

    // When editing a column called Attribute4

    if (e.panel.columns [e.col] .binding == 'Attribute4') {

        // If IsAttribute is not checked

        if (e.panel.rows [e.row] .dataItem.IsAttribute == false) {

            // Disable editing

            e.cancel = true;

            return false;

        }

    }

    return this.beginningEdit.raise (this, e);

};


Control is done when the check box is not checked.

However, I cannot check the important check box.

If you remove the script call in AdvancedFormat, the checkbox will work properly.


Does anyone know this solution?

2022-09-16 08-04-04
Bruno Martinho
Staff
Solution

Sorry that I didn't understood your problem.

It seems that the checkbox becomes not editable because

this.beginningEdit.raise (this, e); returns undefined


So I would suggest to replace:


return this.beginningEdit.raise (this, e);


by


this.beginningEdit.raise (this, e);

return true;


Please let me know if this helps.

UserImage.jpg
Yuichiro Tada

Bruno Martinho wrote:

Sorry that I didn't understood your problem.

It seems that the checkbox becomes not editable because

this.beginningEdit.raise (this, e); returns undefined


So I would suggest to replace:


return this.beginningEdit.raise (this, e);


by


this.beginningEdit.raise (this, e);

return true;


Please let me know if this helps.


Thank you very much.
I fixed the return part and it worked correctly.

UserImage.jpg
Yuichiro Tada

Can anyone please answer my question?

2022-09-16 08-04-04
Bruno Martinho
Staff

Hello,

What Grid version are you using?

If you are using the lastest version, it seems you could try to change:

 if (e.panel.rows [e.row] .dataItem.IsAttribute == false) {

to

if (!!e.panel.rows[e.row].dataItem.os_isSelected == false) {

Please let me know if this helps.

Bruno Martinho

UserImage.jpg
Yuichiro Tada

Version is 2.1.9.


The way I communicated was bad.

You told me about Checkbox Selection of Grid Container, right?


I am using GridColumnCheckbox.

IsAttribute is an image of Entity's Attribute.

I want to control editing when the GridColumnCheckbox changes dynamically.

2022-09-16 08-04-04
Bruno Martinho
Staff
Solution

Sorry that I didn't understood your problem.

It seems that the checkbox becomes not editable because

this.beginningEdit.raise (this, e); returns undefined


So I would suggest to replace:


return this.beginningEdit.raise (this, e);


by


this.beginningEdit.raise (this, e);

return true;


Please let me know if this helps.

UserImage.jpg
Yuichiro Tada

Bruno Martinho wrote:

Sorry that I didn't understood your problem.

It seems that the checkbox becomes not editable because

this.beginningEdit.raise (this, e); returns undefined


So I would suggest to replace:


return this.beginningEdit.raise (this, e);


by


this.beginningEdit.raise (this, e);

return true;


Please let me know if this helps.


Thank you very much.
I fixed the return part and it worked correctly.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.