Hi,
Is it possible to automatically load a selection on the lookup form?
For example; I have a country lookup modal on my CreateOrEditEmployee form and I'd like to add a new employee under country 'Brazil' by clicking a link such that the CreateOrEditEmployee form loads with 'Brazil' selected.
10 Answer(s)
-
0
Hi,
You can open a user lookup modal wherever you want using a sample code like below;
var lookupModal = app.modals.LookupModal.create({ title: app.localize('SelectAUser'), serviceMethod: abp.services.app.commonLookup.findUsers, filterText: '' }); lookupModal.open({}, function (selectedItem) { // user select handle code. });
-
0
Hi @ismcagdas,
My use case is simple. I have an entity Building an entity RentalUnits. One Building has many RentalUnits and on RentalUnit create modal there is Building as a navigation property. So, on the Building actions, I have 'Add Rental Unit' as an action which a user can use to add RentalUnits to a Building. This means that it makes sense to have the respective Building selected when the action is selected.
See Index below;
`var _createOrEditRentalUnitModal = new app.ModalManager({ viewUrl: abp.appPath + 'App/RentalUnits/CreateOrEditModal', scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/RentalUnits/_CreateOrEditModal.js', modalClass: 'CreateOrEditRentalUnitModal' }); { text: app.localize('Add Unit'), action: function (data) { _createOrEditRentalUnitModal.open({ buildingId: data.record.building.id }); }`
Now, I'd like to know how to make this work with the code you shared on here.
Thank you.
-
0