Forum Discussion

detroit's avatar
detroit
Creator I
7 years ago
Solved

How can you open search dialog in javascript with a filter

Hello as per title - how can we set the filter for search dialog in javascript var param = {                 title: title,                 aras: top.aras,                 type: 'Search...
  • christopher_gillis's avatar
    7 years ago

    Hello,

    For this use case, we typically recommend creating a new property on the ItemType to serve as a placeholder to attach your onSearchDialog event to. This will new property is typically not intended to store any data and should be hidden from every form and grid. You can call this property something like filter_placeholder.

    Once you have this new property on the Part ItemType, you can attach your onSearchDialog to it and update your method code to use this new property's name to call the filtering event.

    var param = {
                    title: title,
                    aras: top.aras,
                    type: 'SearchDialog',
                    dialogWidth: 700,
                    dialogHeight: 450,
                    itemtypeName: 'Part',
                    
                    sourceItemTypeName: 'Part',
                    sourcePropertyName: 'filter_placeholder'
                };
    var dialog = wnd.ArasModules.Dialog.show('iframe'param);
    dialog.promise.then(dojo.partial(callbackcopy));

    Chris

    Christopher Gillis

    Aras Labs Software Engineer