Categories

de_epages.presentation.ui.tray()

Categories: UI

de_epages.presentation.ui.tray( options )

Plugin: de_epages.presentation.ui.tray

Description: Display the object tray input and button.

  • de_epages.presentation.ui.tray( options )

    version added: 6.15.0

    options   A map of additional options pass to the method.

The de_epages.presentation.ui.tray() method displays an input and a button which enables the user to search for elements (for example Customer, Products, etc). After the search a dialog is displayed with all results. In the dialog the user can select elements he wants to insert to the current page or change his search. The content of the current tray is although displayed and the user can choose if he want to use the content of the tray or not.

As paremeters for the tray a callback can be defined which gets the selected data from the tray after close. Via the parameter 'additionalContent' it is although possible to add content inside the dialog, this content is although returned to the callback.

additional information for the parameter searchActions

Current available actions:

  • 'Products': 'JSONSearchProductsToInsert',
  • 'Categories': 'JSONSearchCategoriesToInsert'
  • 'Customers': 'JSONSearchCustomersToInsert',
  • 'Users': 'JSONSearchUsersToInsert'
  • 'ShippingMethods': 'JSONSearchShippingMethodsToInsert',
  • 'PaymentMethods' : 'JSONSearchPaymentMethodsToInsert'
  • add tray to search for Products and Categories

    HTML:
    <div class="ep-tay"></div>
    
    Code:
    de_epages.presentation.ui.tray({
      'node': $('.ep-tray'),
      'inputName': 'NewProduct',
      'searchActions': {
        'Products': 'JSONSearchProductsToInsert',
        'Categories': 'JSONSearchCategoriesToInsert'
      },
      'useTray': true,
      callback:function(data){
        console.debug('data',data);
      },
      additionalContent: '<input type="checkbox">'
    });
    
    
  • node

    version added: 6.15.0

    a jQuery object which contains the node to insert the input and button

  • inputName

    version added: 6.15.0

    string for the input, is used for the form if the customer inserts a string in the input and saves page

  • searchActions

    version added: 6.15.0

    an object containing key value pairs for the search actions. The key is the identifier which is used on the server for the data. The value is the ChangeAction which is used to provide the data for the object tray.

  • useTray

    version added: 6.15.0

    flag which desides if the tray content should be displayed inside the dialog or not

  • callback

    version added: 6.15.0

    A method which will called after the dialog is closed via the apply button. Method gets an object with the selected ids, additional content node and a flag if the tray is used

  • additionalContent

    version added: 6.15.0

    a string which is inserted on every dialog page on the bottom to add extra functionality. Will be parsed with metaparse to ensure inputs and other stuff are working.