Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to use Spry and Jquery on the same page.

New Here ,
Mar 03, 2011 Mar 03, 2011

I'm using both spry (dataset) and jquery (datepicker) on my page. When I load the jquery script my dataset doesn't work.

I've done some research and found that I need to insert an observer that tells jquery when the spry dataset is finished loading. Found this information at: http://forums.adobe.com/message/2899897. I've tried implementing this into my script but just doesn't seem to work. Below is the script from my site, how would I insert an observer into this script?

<script type="text/javascript">

<!--

var ds1 = new Spry.Data.HTMLDataSet("/test/fsasearch_results_dynamic.php", "search_results");

var ds2 = new Spry.Data.HTMLDataSet("/test/countstable_dynamic.php", "table");

$(function() { $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd', beforeShowDay: nonWorkingDates, numberOfMonths: 2, minDate: +5, maxDate: +30});

});

    function nonWorkingDates(date){

        var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6;

        var closedDates = [[7, 29, 2009], [8, 25, 2010]];

        var closedDays = [[Saturday], [Sunday]];

        for (var i = 0; i < closedDays.length; i++) {

            if (day == closedDays[0]) {

                return [false];

            }

        }

        for (i = 0; i < closedDates.length; i++) {

            if (date.getMonth() == closedDates[0] - 1 &&

            date.getDate() == closedDates[1] &&

            date.getFullYear() == closedDates[2]) {

                return [false];

            }

        }

        return [true];

    }  

 

//-->

</script>

TOPICS
Server side applications
508
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 04, 2011 Mar 04, 2011
LATEST

Please post any SPRY related question in the SPRY forum.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines