NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on May 10, 2017, 09:55:16 AM

Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Alberto on May 10, 2017, 09:55:16 AM
Hi,
I am calling a  form from a JS calendar using
ntd.push(....
All is ok but how do I refresh the calendar from the form "save" button?
I need to call the proc when I set the json events data and then the calendar itself.
Ive setted the CalledFrom: to the Calendar NetWebForm that contains the Calendar and the _event_ value reaches ok with gainfocus value.
Thanks

FXIW: this is the js Im using: https://fullcalendar.io
Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Bruce on May 11, 2017, 01:42:41 AM
>> All is ok but how do I refresh the calendar from the form "save" button?

determine the JavaScript your widget needs to refresh itself.
then call this in the PostInsert and PostUpdate routines in the form procedure, using the Script tag.

For example, say the javascript is whatever.refresh();
Then you would embed the code

p_web.script('whatever.refresh();')

Cheers
Bruce
Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Alberto on May 11, 2017, 06:15:08 PM
Thanks, another problem...

The JS has several properties that I need to be changed by the user, example:

   $('#calendar').fullCalendar({  
       height: 300,
       aspectRatio: 2,
       slotDuration: '00:15:00',
       minTime: '10:00:00',
       maxTime: '17:00:00',

Where in the NetWebForm that contains the calendar.js do I add, by example:

    p_web.Script('$(''#calendar'').fullCalendar(''option'', ''height'', 700);')

for the height to be change at run time?

Thanks

Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Bruce on May 11, 2017, 10:25:55 PM
>> that I need to be changed by the user,

how will the user change the options? while the date picker is open? or in some sort of user configuration?

I think you need to explain a lot more what you have in mind in order to predict where in the code might be best.

cheers
Bruce
Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Alberto on May 12, 2017, 03:12:56 AM
I am not talking of datpicker.
Im talking about a js called fullcalendar that Im implementig
Its working ok now but I need to chenge some params dependin on the user
The User record has this data, it is set by the user in its profile.
Then I need to change the fullcalendar.js
As I said in my last post:

The JS has several properties that I need to be changed by the user, this is how the JS begins

   $('#calendar').fullCalendar({ 
       height: 300,
       aspectRatio: 2,
       slotDuration: '00:15:00',
       minTime: '10:00:00',
       maxTime: '17:00:00',

Where in the NetWebForm that contains the fullcalendar.js do I add, by example:

    p_web.Script('$(''#calendar'').fullCalendar(''option'', ''height'', 700);')

for the height to be change at run time?

Thanks
Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Bruce on May 12, 2017, 06:01:12 AM
The form is an event handler.
On which event do you want the change to occur?

Cheers
Bruce
Title: Re: Call Nettalk Form - JQuery UI Dialog from a Scheduler Javascript Library
Post by: Alberto on May 13, 2017, 10:04:20 AM
Done, thanks