Disable click after date is over
Disable click after date is over
mstudio
Posts: 14Questions: 2Answers: 0
I using "dataTable" to show travel dates where the layout is for right to left
Dates | Cycle | Status | Ordering button
the ordering button is calling javascript that populate form with some values.
the question is how I can disable the click on the button after the date is over, can I check some text of the cell and if this equal to some text then the button is active and if it is equal to other text it is inactive? or better to check the dates?
This discussion has been closed.
Answers
If I understand your question right, using render ( https://datatables.net/reference/option/columns.render ) , something like
(note: I used moment for this ( http://momentjs.com/docs/#/query/is-after/ )
Thanks, I will try it, "moment" is part of "datatables" or I need to add it?
I using dates range something like this "04/05/2018-09/05/2018".
I can just check the status and change the order button?
I do not understand where is the part setting the button, how this is work?
There is way to test this?
MomentJS is a date time library that is not included in DataTables. You'd need to add it if you want to make use of its abilities through the plug-ins available for DataTables.
If that is what you want to do, yes. However from your original question it sounds like you want to control each button in the column, which is what @Bindrid2's solution does.
Allan
Can you help to do it on this example page:
http://80.244.168.168/tours/jeep-tour-in-the-mountainous-greece-and-villages-of-zagorija/
The table is on the third tab from the right (titled: מחירים ותאריכים)
I want to disable and green button and change it color when the dates are passed
Still need help, new URL is
https://israel4x4.com/tours/jeep-trip-to-romania-the-carpathian-mountains-of-transylvania/
I checked to code, there was some error of missing closing of brackets.
The code remove the data of Status column but I want to keep it, I want to enable or disable the order button.
I getting undefined for 'row.Status' and for 'row.Dates' when I checked with alert.
if the order of
matters?
I using Hebrew so the order of the table is
It is the third tab from the right labeled "מחירים ותאריכים"