OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions DataGrid rowSelection change checkbox select status to disabled

This topic contains 3 replies, has 3 voices, and was last updated by  juan 6 years ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #29606

    juan
    Participant

    Hi team!!

    I follow this example ( advanced grid configuration: “grid should show users for group that currently editing and user should be able to add/remove users from group” ) and set selectors for include and exclude in :data_in and :data_not_in.

    Everything works as expected, but i would like do not allow to deselect chekboxes for those rows that are already selected. Add somthing like inmutable rows.

    I try adding new datagrid builder (requireJSModules option) and disabled checkboxes that has status checked, but didn’t work. Also i try creating a new frontend_type, but rowSelection with include/exclude options seems to works only with boolean frontend_type.

    Can anyone, please , point me in the right direction?

    Thanks very much to all!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #29607

    Andrey Yatsenko
    Moderator

    You can debug JS in dev mode (app_dev.php) with Chrome DevTools for example, set a breakpoint in script you are working with to find what is wrong here.
    Instead of registering new can also try to override existing datagrid builder if it will be easier with the following instruction https://oroinc.com/orocrm/forums/topic/how-to-override-js-file#post-53814

    Hope this helps.

    #29608

    Hryhorii Hrebiniuk
    Participant

    Hello @juan

    Generally column options “editable” has boolean value. But Backgrid also supports approach “editable” as a function. But we can not pass a function over JSON, so we need define it in other way. And custom gridbuilder defined over requireJSModules probably will be best solution. See example:

    But unfortunately, after defining “editable” as a function, you’ll face another issue. Our extend of BooleanCell also is not ready to it. You’ll need to use approach proposed above by @Anyt to override BooleanCell and replace lines

    to

    We’ll fix it for upcoming versions, but for your current version you’ll need to use ReauireJS map module approach.

    #29609

    juan
    Participant

    Thanks for the rapid response!!

    I solve the implementation re mapping BooleanCell with my custom class in requierejs.yml as @Anyt mentioned.

    Thanks!!
    )))

Viewing 3 replies - 1 through 3 (of 3 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top