Page 1 of 1

Button to left of each row to select entire week?

PostPosted: Wed Jul 25, 2012 5:57 pm
by tylertul2
Hey John!

Looking forward to your post Devcon reports :-)

Wondering if there is a relatively easy way to put a button to the left of each row of Ninjacal to be able to select that entire week with one click instead of click Sun, hold shift, click Sat? I tried to figure it out myself but couldn't find a way that didn't require quite a bit of code.

We are using Ninjacal for filtering our schedules it works great! Thanks again.

Best wishes,

~ Tyler

Tyler Tullock
Director
4/4 School of Music

Washington | Oregon | Texas

Website: http://www.44school.com

Re: Button to left of each row to select entire week?

PostPosted: Sun Jul 29, 2012 12:25 pm
by JasonYoung
Hi Tyler,

You can do this by setting the global variables manually and then running a refresh to see the highlighting, but not super easy.

For the first row you could get the "Saturday" by reading the NinjaCal::NinjaCal_basic[7] (seventh repetition), and then looping down from there to build your lists for $$__NinjaCalSelectedList and $$__NinjaCalSelectedNumbers.

You can get the numbers by using GetAsNumber() around the date value.

You can then build the $$__NinjaCalSelectedRange from the last and first dates in the $$__NinjaCalSelectedList.

The just call a refresh window and you'll see the highlighting update.

Let me know if that helps,
Jason

Re: Button to left of each row to select entire week?

PostPosted: Sun Jul 29, 2012 10:56 pm
by tylertul2
Thanks Jason,

A bit more complicated than I was hoping for but I will get it done with your suggestion. Thanks again and we are really enjoying NinjaCal.

Best wishes,

~ Tyler

Tyler Tullock
Director
4/4 School of Music