Hello Everyone,
I have two module Inventory Item and Test System and have a custom sidecar in Inventory Item module, where I am showing Test System records in sidecar according to work product(Field in both module as related field). I am using custom API to show sidecar records.
Now I want to add custom filter and search using custom API. Please help if have anyone any solution.
I have added Filter and Search Box using code but not working. How can trigger custom API when I search and filter record. Or tell me if it is possible with JS files.
var wpLayout = this.layout.layout.getComponent("dashboard-pane").getComponent("ts-selection");
var wpView = wpLayout.getComponent("main-pane").getComponent("filterpanel").getComponent("customTs-selection");
var wpModels = [];
if (wps.records && wps.records.length > 0) {
wpModels = wps.records;
}
wpView.collection.reset();
wpView.collection.add(wpModels);
///viewDef
$viewdefs['Inventory_Item']['base']['layout']['ts-selection'] = array(
'type' => 'selection-list',
'components' => array(
array(
'layout' => array(
'type' => 'base',
'name' => 'main-pane',
'css_class' => 'main-pane span12',
'components' => array(
/* array(
'view' => 'selection-list-context',
), */
array(
'layout' => array(
'type' => 'filterpanel',
'availableToggles' => array(),
'filter_options' => array(
'stickiness' => false,
),
'components' => array(
array(
'layout' => 'filter',
'loadModule' => 'Filters',
),
array(
'view' => 'filter-rows',
),
array(
'view' => 'filter-actions',
),
array(
'view' => 'ts-selection',
'context' => array(
'module' => 'Inventory_Item',
),
'loadModule' => 'Test_System',
),
),
),
),
),
),
),
),
);
'type' => 'selection-list',
'components' => array(
array(
'layout' => array(
'type' => 'base',
'name' => 'main-pane',
'css_class' => 'main-pane span12',
'components' => array(
/* array(
'view' => 'selection-list-context',
), */
array(
'layout' => array(
'type' => 'filterpanel',
'availableToggles' => array(),
'filter_options' => array(
'stickiness' => false,
),
'components' => array(
array(
'layout' => 'filter',
'loadModule' => 'Filters',
),
array(
'view' => 'filter-rows',
),
array(
'view' => 'filter-actions',
),
array(
'view' => 'ts-selection',
'context' => array(
'module' => 'Inventory_Item',
),
'loadModule' => 'Test_System',
),
),
),
),
),
),
),
),
);
Thanks,
Laxmichand saini