Hello, I am using calendar report in phpmaker 2024.15 but I am having problems when adding an event, it always places a day later when opening the add form, another problem I have is that when I add the event when returning to the calendar, the calendar does not refresh with the added event, I know there is a reload() method, but I don’t know in which event to put it within client scripts, could someone help me with this, thanks in advance
Make sure the timezone of your locale is properly set, see Locale Settings.
Thanks, I have another question: how can I know what name a table field has at the clientscript level? I need to see and change its value at the frontend level.
What did you mean by “what name a table field has at the clientscript level”? You may want to give an example.
There are:
- currentTable (global variable, under window object)
- ew.vars.tables
Both can give you tablename and fieldname(s) on client-side.
arbei wrote:
What did you mean by “what name a table field has at the clientscript level”? You may want to give an example.
ok por example, for example, the column is called DateSol, at the Server Script level: $this->FechaSol->CurrentValue
at client script level: $(“#x_FechaSol”).val()
How do you know how to manipulate the column? using the prefix #x_?
#x is not prefix.
is jQuery selector for id attribute
If you inspect the elements, most likely you’ll find the data wrapped in (for List and View) or (for Add and Edit).
With that or you’ll find id attribute, for example:
<input id="x_FechaSol" ...etc... />
To manipulate that element, first you have to select it by it’s id attribute (id selector is preferable because it’s the fastest performance).
If you use jQuery it’s: $(“#x_FechaSol”)
- $ is the jQuery object
- () is to call the object as a function
- “#x_FechaSol” is the selector to select the element
-
is to select it by it’s id
- x_FechaSol is the value of the id attribute
Then, you apply jQuery methods, e.g. val()
- $(“#x_FechaSol”).val() to get the value
- $(“#x_FechaSol”).val(“somevalue”) to set “somevalue” into
You can also use pure Javascript instead of jQuery. To select that in javacript: document.getElementById(“x_FechaSol”)
Then, you apply javascript methods.
Note that jQuery and javascript share many similar methods but they’re not the same.
sangnandar, very grateful for your explanation to clarify my doubts, very kind for your time