[solved]: Get value change event of html input inside a ReportControl?


Antonio Cambule

Hi David,

I've put an

inside the html property of an Report Control.

Now i don't want to catch the click like it is used in many samples:

But i want to catch the event when the value is changed. Is that possible?

Thanks and regards
Antonio


DecSoft

Hello Antonio,

Various things to be considered here. Certainly, look at the below code, which can be placed in the HTML property of a Report control:

Looking at the above code we find various things:

1º We use "RecordInput{{Record.ID}}" for the input's ID. In this way we get valid IDs for every input, since our inputs IDs become "RecordInput1", "RecordInput2", etc.

2º We introduce the "ng-model" attribute (from AngularJS), which is required if we plain to use the "ng-change" one.

3º As you can see in the below attached app sample, the "ReportInputChange" app's function is called when the input model/value change.

4º But we really need such app's function? Maybe, but, note that the model, that is, the "Record.Name" variable, changes automatically when we changes it in the input control. In other words, if we take a look at the "Report.Data" variable after change the input's model/value, we can see that variable reflect the changes, without our intervention.

Take a look at this application sample: ReportInputs.zip, and tell know if you you have any further questions Antonio.

P.S. The "Report17" app sample also shown us how to use an specific app's function when a Report's record's link is clicked.



Antonio Cambule

Hi David,

thanks a lot. That's great. To point 4, i need it in order to do value validation and change the value to something valid, if it doesn't fit.
I got it to work. The report control is such a great thing. I could style and change into the behaviour we had in mind. Doesn't mean that it is good ;-), but it's great to have this freedom.

As always good support, thanks
Antonio


DecSoft

Hello Antonio,

Always thanks you! :)



DecSoft

Hello again!

One more thing. Maybe what we need is not the ID of the Report's record, because in fact this ID must be provided by our Report's source, but, may we not always have a field like that. Fortunatelly we can use the "index" of the records, which is always available and, in fact, reflect exactly the position of the record in the Report's Data variable.

We can use some code like the below one:

... instead of the above. In this case what we receive and use is the record's index (in the Data variable) and not any record's ID field.

Hope this can help in some manner too.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.