OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

This topic contains 19 replies, has 9 voices, and was last updated by  Sufiyan Malek 4 years, 9 months ago.

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

  • Creator
    Topic
  • #34606

    stalxed
    Participant

    Hello!

    I create custom mass action, but JavaScipt not work.

    I create:
    1) Mass action

    2) Register mass action

    3) Use it in datagrid.
    4) Create file Resources/config/requirejs.yml

    5) Create file Resources/config/oro/assetic.yml

    6) Create file Resources/public/js/datagrid/action/test123-action.js

    7) Clear cache.
    8) Performs commands:
    php app/console assets:install
    php app/console assetic:dump
    php app/console oro:requirejs:build

    Action work good as Ajax Action, but extend of JavaScript action not work. Why?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Author
    Replies
  • #34607

    Alexandr Smaga
    Participant

    Hello @stalxed!

    Not sure that I got your issue well. Code looks OK for me, did you add your test123 thru grid config to some grid ? Could you please give mroe details what doesnot work ?

    I see that “delete mass action” inherited from MassAction class(see)

    #34608

    stalxed
    Participant

    Thank for answer!

    I found a bug, need set frontend_type:

    Now work fine!

    #34609

    Alexandr Smaga
    Participant

    Hello !

    Thank you for your reply, hope this topic will be useful to someone from community. It will be nice to have this in bundle doc!

    #34610

    stalxed
    Participant

    I wrote several types of mass action for data grid.
    I want to say thank you so much!!!

    Very powerful system in the extension! A number of complex actions made ​​simple and elegant!

    #34611

    golriz.nourani
    Participant

    I am try to write a mass action of widget type as below

    mass action

    — mass-action.yml

    Resources/config/requirejs.yml

    Resources/config/oro/assetic.yml

    — Resources/public/js/datagrid/action/change-action.js

    add below mass-action to datagrid.yml of OroCrmContactBundle

    but when I want to load contact grid I have below JavaScript error on browser
    Uncaught TypeError: “model” is required

    could you help me?
    thanks a lot

    #34612

    Yevhen Shyshkin
    Participant

    Hello.

    Each action is associated with the appropriate grid row model (that contains row data). Please, check where it is not passed and pass it there (see other grid actions for example).

    #34613

    zhex900
    Participant

    Hi,

    I have the same issue. Uncaught TypeError: “model” is required. Do did you solve it? Which grid action should I look at?

    Jake He

    #34614

    dnahrebecki
    Moderator
    #34615

    dnahrebecki
    Moderator

    marked as resolved

    #39857

    Sufiyan Malek
    Participant

    Hi,

    Need to create mass action for “send to customer quote”. How should I do this ? Need to open multiple dialog of send to customer quote modal when select multiple from grid. and it has all different content in quote mail and different receivers like in quote section.

    #39879

    Hryhorii Hrebiniuk
    Participant

    Hi,

    You need to develop your own SendCustomerQuoteMassAction, extended it from based mass-action. Take a look how base mass-action works and how it gathers selected items. Keep in mind that selection may contain items that are not presented on current grid’s page. See https://github.com/oroinc/platform/blob/0c2a47b/src/Oro/Bundle/DataGridBundle/Resources/public/js/datagrid/action/mass-action.js#L84-L90

    Also it is good practice to limit the number of selection, see how it is done for merge action
    https://github.com/oroinc/platform/blob/a7e1107/src/Oro/Bundle/EntityMergeBundle/Resources/public/js/datagrid/action/merge-mass-action.js#L42-L69

    If all selected items are presented on the grid’s page, you can take those quotes from the grid’s collection and find there action_configuration.b2b_quote_backoffice_approvals_send_to_customer_transition.dialogUrl. That URL is used for loading dialog widget with email form.

    But, since selected items may not be from current page, it is better to determine all ids of selection first. Then check ACL, if it is possible to submit all those quotes. And after that, generate URLs for dialog widgets on sever-side and send them within response of SendCustomerQuoteMassAction request.

    #39890

    Sufiyan Malek
    Participant

    Hello,
    I am new to OROCRM. Thanks for the quick response Hryhorii.

    I created mass action and got selected Id’s from getActionParameters. But I did not understood b2b_quote_backoffice_approvals_send_to_customer_transition process.
    How to get all selected quote modal popups from grid quote Id’s and load dialog widget with email form ?

    Any help appreciate.

    Thanks

    #39891

    Andrey Yatsenko
    Moderator

    You can build the link by using the routing component.
    route name is oro_workflow_widget_transition_form it applies workflowItemId and transitionName as arguments.

    workflowItem can be found with Oro\Bundle\WorkflowBundle\Model\WorkflowManager::getWorkflowItem($entity, $workflowName);

    #39892

    Sufiyan Malek
    Participant

    Hello,
    I just not only want route. But I need to build MassAction for SendCustomerQuoteMassAction functionality which open multiple dialogue popups of emailQuote after selection of multiple rows from grid and send it one by one from opened window.

    thanks a lot

    #39893

    Andrey Yatsenko
    Moderator

    The route is for opening a popup.

Viewing 15 replies - 1 through 15 (of 19 total)

The forum ‘OroPlatform – HTML, JavaScript, CSS, Design Questions’ is closed to new topics and replies.

Back to top