#1 2016-09-09 06:55:59

reg4app
Member
Registered: 2016-05-16
Posts: 147

How to call an app's function from a Report's record's HTML

I have a link in a report's footer,and I want user to click this link(or otherthing) to do like :
change this link into another link for downloading a file,
or to access AB other variables

I try to test by set the footer

<td colspan="3" class="bg-info text-center">
 [App.Name], [App.Description] [aa1] <a href="#" onclick=window.App.Scope.test1();">aaa1a</a>
</td>

the test1 function

window.App.NewView1.Scope.Button1.Text="gsgegee";

but seems not work....,please give some clues


Joshua.Y

Offline

#2 2016-09-09 08:29:06

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to call an app's function from a Report's record's HTML

Hello Joshua,

Please, take a look at the "Report8" sample, which include some "buttons" ni the report's records HTML and shown us how we can react when such buttons are clicked by the user. In this case we use the "RowClick" event and look for an "ID" attribute of the clicked button.

Additionally, yes, we can call an application function from a Report, just take a look at the below code, which is a modification of the Report's HTML code of the "Report8" sample:

<div class="col-sm-4">

 <div class="panel panel-info">
  <div class="panel-heading">[Record.ID]</div>
  <div class="panel-body">
   <p><strong>[Record.Title]</strong></p>
   <p>
    [Record.Description]
   </p>
   <div>
    <button ng-click="$parent.MyAppFunction(Record.Title)"
     class="btn btn-info btn-block">Click me!</button>
   </div>
  </div>
 </div>

</div>

As you can see we call to a "MyAppFunction" app's function passing the record's title as an argument.

Offline

#3 2016-09-09 08:41:24

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to call an app's function from a Report's record's HTML

Hello Joshua,

The next App Builder release includes a new "Report17" sample, which shown us how we can call to app's functions from Report's records' HTML code. I attach here this new "Report17" sample for your convenience:

Report17.zip

Offline

#4 2016-09-09 10:27:00

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to call an app's function from a Report's record's HTML

OK,I will study this

and by the way,will Report control get a 'page' Function!?

I am not sure this function is necessary,So far the report control is good enough for me,but maybe a 'page' option will give the user more ways to show the data.


Joshua.Y

Offline

#5 2016-09-09 10:27:57

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to call an app's function from a Report's record's HTML

Hello Joshua,

reg4app wrote:

OK,I will study this

and by the way,will Report control get a 'page' Function!?

I am not sure this function is necessary,So far the report control is good enough for me,but maybe a 'page' option will give the user more ways to show the data.

What is a "page function"?

Offline

#6 2016-09-09 10:36:23

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to call an app's function from a Report's record's HTML

split the data by page....


Joshua.Y

Offline

#7 2016-09-09 10:38:27

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to call an app's function from a Report's record's HTML

Hello Joshua,

Are you try with the "Report9" sample? We can always split the Report's data and then paginate the Report's contents.

Offline

#8 2016-09-09 10:44:03

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to call an app's function from a Report's record's HTML

Oh,sorry,there are so many samples:) ,not enough time to study it through
See,you already get it ready!


Joshua.Y

Offline

#9 2016-09-09 10:57:50

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to call an app's function from a Report's record's HTML

Hello Joshua,

No problem! Please let me if that sample can be useful for you or what. wink

Offline

#10 2016-09-09 11:17:17

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to call an app's function from a Report's record's HTML

Is this html code only work in <button> </button>??
will it work in <a> </a>, that is a text link!


Joshua.Y

Offline

#11 2016-09-09 11:19:19

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: How to call an app's function from a Report's record's HTML

Hello Joshua,

Yes; we can use also a link:

<td>
 <a ng-click="$parent.ReportRecordClick(Record.ID)">[Record.Name]</a>
</td>

Offline

#12 2016-09-12 04:17:31

reg4app
Member
Registered: 2016-05-16
Posts: 147

Re: How to call an app's function from a Report's record's HTML

test and work smile


Joshua.Y

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.