I have one column in my Embedded View Table which has a button for Date selection for each record . My question is, how can I hide (make invisible) the button when the value equals to selected date? And how can I keep the button visible if the value is null?
Can you provide a little more detail? Is this a Perspective or Vision table?
If Perspective, I'm assuming you are using an embedded view on the table column to display the button. If so, then you can tie the button visibility property to an expression binding which checks the date property.
But the basics are (I have not tested any of this!):
Create an embedded view. Call it 'evTableDateInput'.
The embedded view should have one input param: rowData
The table component will pass an object containing the data for the table row in this, including your 'SelectedDate' field.
The embedded view should have two components:
a label to display your date
and a datetime input component
Tie the label text property to your passed date with an expression binding:
toStr({view.params.rowData.value.SelectedDate})
Tie the visibility property of both components to the view param:
toDate({view.params.rowData.value.SelectedDate},0)!=0 (for the label so it shows if date is set)
toDate({view.params.rowData.value.SelectedDate},0)=0 (for the datetime so it only shows if no date is set)
In your table columns:
Change the render of your date column from 'date' to 'view'.
Set the viewPath on your date column to point to the your embedded view 'evTableDateInput'.
Note: Given the way the datetime input component works, you could probably get by with just using it in your embedded view since it will display a date.
Note 2: Getting the selected date out of the table, using it and/or saving it to a DB is a completely different task.
Note 3: I made a lot of assumptions about how your table data is organized. Whether you're using JSON data, dataset, arrays of objects, etc. will affect how you reference the passed row data in your embedded view.