Forum Discussion
8 Replies
- christopher_gillisNew MemberHello, Could you please clarify your use case? Typically, double clicking a search dialog will only close the dialog when one item is expected to be returned such as an item property. If the search dialog can return multiple results such as when adding relationships to the relationship grid, double clicking will not close the search dialog. Chris ______________________________________________ Christopher Gillis Aras Labs Software Engineer
- Former_MemberIdeator IHi Chris, Because I have customized needs,I use the item dialog change to multiple select.(ex:I want to select multiple Identity no use relationship.) When I click the item, it will set value to another field. So, when I open the item searchdialog and doubleclick, do not close the searchdialog. Thanks.
- christopher_gillisNew MemberHello, It sounds like you are calling this dialog directly from a custom method. If that's the case, you can pass in a "handler" function as a parameter that can be used to override the default behavior of a click or doubleclick. Please see an example of this below. Chris ________________________________________________ Christopher Gillis Aras Labs Software Engineer
- Former_MemberIdeator IHi Chris, Thank you for your assistance in resolving my long-awaited question. ^^
- Former_MemberIdeator IHi Chris, Sorry, I have another question. If I want to add default criteria to the search dialog when open the search dialog . What can I do? Thanks.
- christopher_gillisNew MemberHello, It is possible to set a filter from an onSearchDialog event on the Property that opens the dialog using code like the sample below. <script src="">gist.github.com/.../script> However, since you are opening this dialog from a method instead of directly from a property, you will need to follow the steps below to add a "dummy" property that will hold the filter for this search dialog.
- Create a "dummy" property on the ItemType that is calling the search dialog with the following information
- Name: dummyForFilter
- Type: String
- Length: 1
- Hidden1: true
- Hidden2: true
- Right-click on this new Property and select "View Properties"
- Create a Method with the filter code above and add it as an "onSearchDialog" event to this property
- Save, unlock, and close both the Property and the ItemType
Following this example, you will see that the "state" column of the resulting search dialog now auto-populates with a value of "Released" and cannot be changed. Chris _______________________________ Christopher Gillis Aras Labs Software Engineervar param = { aras: top.aras, type: 'SearchDialog', dialogWidth: 700, dialogHeight: 450, itemtypeName: 'Part', multiselect: true, handler: addRelationshipHandler, sourceItemTypeName: "Part", // <-- The name of your ItemType sourcePropertyName: "dummyForFilter" // <-- The name of your dummy property };
- Create a "dummy" property on the ItemType that is calling the search dialog with the following information
- Former_MemberIdeator IHi Chris, It's work. But the filter method by different parameter. Can I send self parameter to the searchdialog? Thanks. Ex: var param = { aras: top.aras, type: 'SearchDialog', dialogWidth: 700, dialogHeight: 450, itemtypeName: 'Part', multiselect: true, handler: addRelationshipHandler, sourceItemTypeName: "Part", // <-- The name of your ItemType sourcePropertyName: "dummyForFilter" // <-- The name of your dummy property myparameter:test}; onSearchdilog: var param= this.getProperty("myparameter"); var Filter = {}; Filter["_setting_type"] = {filterValue:"param",isFilterFixed:true}; return Filter;
- christopher_gillisNew MemberHello, It doesn't appear possible to access the parameters passed to the Search Dialog through the method that applies the filter. That being said, it may be possible to create a copy of the SearchDialog.html file in the code tree and modify that copy to accept an additional "filter" parameter. We do not have any samples of customizing the SearchDialog in this way, but you can modify your method based on the sample below to call your custom Search Dialog.
Chris ___________________________________ Christopher Gillis Aras Labs Software Engineervar Filter = {}; Filter["state"] = { filterValue: "Released", isFilterFixed: true }; // Set up parameters for search dialog var param = { aras: top.aras, content: 'SearchDialogWithFilter.html', // <-- Use "content" rather than "type" to point to a specific .html page dialogWidth: 700, dialogHeight: 450, itemtypeName: 'Part', multiselect: true, handler: addRelationshipHandler, sourceItemTypeName: "Part", sourcePropertyName: "dummytrigger", myCustomFilterParam: Filter // <-- Pass in the filter parameter that you've added to your custom SearchDialog };