EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 14, 2024, 07:02:55 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
General Discussion
>
How to handle onLoadSuccess if form load was used twice
Pages: [
1
]
« previous
next »
Print
Author
Topic: How to handle onLoadSuccess if form load was used twice (Read 7584 times)
karogel
Newbie
Posts: 28
How to handle onLoadSuccess if form load was used twice
«
on:
November 02, 2016, 01:15:03 AM »
I have this code:
var flag;
function loanproposalshow(){
var row = $('#dg_application_ci').datagrid('getSelected');
if (row){
// open dialog
$('#dlg_application_proposal').dialog('open').dialog('setTitle','Loan Proposal');
$('#fm_application_proposal').form('clear');
var url_recom = 'modules/data/get_loanrecom.php?id='+row.maker_id+'&loanappid='+row.app_loanappid;
$('#fm_application_proposal').form('load',url_recom);
$('#fm_application_proposal').form('load',row);
$(function(){
$('#fm_application_proposal').form({
onLoadSuccess:function(){
flag = true;
calc_recom_apa();
}
});
});
url = 'modules/application/update_application.php?loanappid='+row.app_loanappid;
}
}
I am having a problem in calling calc_recom_apa function. It should initiate after the 2 form load and not from the first "form('load',url_recom)"
Logged
battlezad
Newbie
Posts: 44
Re: How to handle onLoadSuccess if form load was used twice
«
Reply #1 on:
November 02, 2016, 05:43:16 AM »
var flag = false;
...
onLoadSuccess:function()
{
if(flag) calc_recom_apa();
flag = true;
}
Logged
karogel
Newbie
Posts: 28
Re: How to handle onLoadSuccess if form load was used twice
«
Reply #2 on:
November 03, 2016, 07:39:10 PM »
var url_recom = 'modules/data/get_loanrecom.php?id='+row.maker_id+'&loanappid='+row.app_loanappid;
$('#fm_application_proposal').form('load',url_recom);
$('#fm_application_proposal').form('load',row);
is the above code OK? i am trying to load the data from "url_recom" and "row" data (from datagrid).
if i will use onLoadSuccess, will it fire after the first form(load ? or after the last form(load or is therea way to comine the 2 data source into single form(load
Logged
andyj
Jr. Member
Posts: 57
Re: How to handle onLoadSuccess if form load was used twice
«
Reply #3 on:
November 07, 2016, 03:01:25 AM »
If you are trying to combine data from two datasources into one datagrid or into one form, why don't you assemble your data using sql from your multiple datasources and combine it into a single json file?
Then load the data into your datagrid/form with distinct fields (some relating to datasource 1, some relating to datasource 2).
THen when you update/insert/delete, post the form variables to your controller, parse out the respective field values and do your CRUD operations to the 2 different tables/databases in your (Php) controller using the respective field values.
Does that make sense?
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...