This is a migrated thread and some comments may be shown as answers.

DataForm

1 Answer 50 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Saovik
Top achievements
Rank 1
Saovik asked on 31 Aug 2016, 04:54 AM

Hello,

I am evaluating DataForm for my business mobile app. I would like to show/hide a editor based on a property in the class which is bound to form. This property will be public property and has no control associated with it. It just holds the boolean state. Now i want to bind this to the 'hidden' property in the form.

For example isNewPolicy is a property is a boolean property with a corresponding private member _isNewPolicy

XML: Page

<df:EntityProperty name="ownershipchange" displayName="Ownership Changed" index="10" hidden="isNewPolicy" >
                            <df:EntityProperty.editor>
                                <df:PropertyEditor type="Switch" />
                            </df:EntityProperty.editor>
                        </df:EntityProperty>

Model:

 

private _isNewPolicy:boolean = true;

    get isNewPolicy():boolean{
        return this._isNewPolicy;
    }

    set isNewPolicy(value:boolean){
        this._isNewPolicy = value;
    }    

The show and hide works fine but the BIG problem is that now I see a check box which is rendered in the form with the value _is New Policy at the top. My understanding is that the form is not respecting the private access modifier of the member variable and thinks it has to be shown on the page but in this case I dont want this to be shown. How to fix this ?

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 05 Sep 2016, 01:49 PM
Hello Saovik,

Thanks for writing and for your question. There's currently a known limitation in the UI for NS DataForm which we have successfully resolved and will release in a week with UI for NativeScript 1.4.

You will then be able to dynamically show and hide editors depending on property values on the view-models.

Let us know in case you have further questions.

Regards,
Deyan
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussion
Asked by
Saovik
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or