开发者

DHTMLX calendar enable / disable in whole website

I am working on website (built using PHP, Mysql, jQuery) which require that admin set a variable in co开发者_如何学Pythonnfiguration and according to that configuration variable jQuery autocomplete is enabled or disabled to all website. Is there any way to achieve that functionality.


The easiest way to do it is to add a common id, or other attribute to all the parent elements where the schedule shows up. Then include into your main javascript file something of the form

  FLAG = 1; //for visibile, or 0 for invisible
  $('#calendar').toggle(FLAG);  //OR
  $('[rel=calendar]').toggle(FLAG);

If you wanted that to come from php, you can always load your javascript within php:

  functions.js.php:
     FLAG = <?php $CAL_SETTING ?>
     //go on with the rest of the javascript



  //then include it into your html
  <script language="javascript" src="functions.js.php"></script>

Good luck!


create a table setting with these fields [name, value,..] and set the name calendar_status value hide

in your view you can get read of that field from you DB and set the myCalendar.hide(true); or myCalendar.hide(false);

myCalendar = new dhtmlXCalendarObject("DateStart"); 
myCalendar.hide(); <- you php code like <?php echo calendar_status; ?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜