Binding Tap event to RadDataForm controls


#1

My design requirements are to have a link label inside RadDataForm, clicking upon link will navigate to another screen. Can I bind a Tap event to Label control of RadDataForm or any work around?


#2

I don’t think you can bind tap or any events, but a work around could be setting up a custom editor.


Binding Tap event to Label in RadDataForm
RadDataForm put tap event to label of a field
#3

Hi @manojdcoder,

Wonderful workaround!

I have a further question. When the RadDataForm source such as ‘person’ is not configured immediately, this example will not work.

For example, i add some delay to simulate the http request process, then the ‘email’ label fails to show.

        setTimeout(()=>{
            this.person = {
                "name": "John",
                "age": 23,
                "email": "john@company.com",
                "city": "New York",
                "street": "5th Avenue",
                "streetNumber": 11
            };
        },5000)

I try to invoke dataForm.reload() after the person data is set, but it still doesn’t work.

Anyone can help to fix this issue?


#4

At least try to set person to empty object initially, let me know if that works.


#5

Hi @manojdcoder

Thanks for you reply.

I tried:

First, set person to ‘{}’ or ‘null’, neither can work.

Then, set person to a valid value, then update it after some delay, the label can show the initial value, but can’t be updated.


#6

Hi @manojdcoder
I found a strange error. When i modify the value of source in ngAfterViewInit(). The DataForm display twice!
Here is the code,

BTW, this issue only occur on IOS.


#7

Try calling .reload() once your form is loaded (native views are created) and while updating your data source (person).


#8

Thanks @manojdcoder.
reload() can clear the displaying twice issue.
Next, I need to find a way to solve the update problem.