0
Garysund created
Hi There
I Extended the Jtable user list to include a new action ICompany Profile.
{
text: app.localize('CompanyProfile'),
visible: function (data) {
return data.record.id !== abp.session.userId;
},
action: function (data) {
abp.ajax({
url: abp.appPath + 'Mpa/CompanyAdmin/Index',
data: JSON.stringify({
userId: data.record.id
})
});
}
},
When I click on the action it steps into the controller and passes through the data correctly but when it tries to return the view it does nothing then gives an error. It does not log anything in the logs.
Controller
public async Task<ActionResult> Index(CompanyAdminModel input)
{
var businessUnits = await _documentFilterAppService.GetBusinessUnitsForCombobox();
var userid = input.UserId;
var UserCustomerNumbers = _customerNumberAppService.GetCustomerNumbersByUser(userid);
var userProfile = await _profileAppService.GetCompanyProfileForAdminEdit(userid);
var model = new IndexViewModel(businessUnits, UserCustomerNumbers, userProfile);
return View(model);
}
How to I go to a new view from a jTable action? Technically it would be leaving the user list page and going to the company profile page.
Thanks
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
0
Sounds like you want to do this instead:
action: function (data) { window.location.href = abp.appPath + 'Mpa/CompanyAdmin/Index?userId=' + data.record.id; }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks solved it so simple
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)