Reset POST/GET values for unit view

Hi.

I’m using Unit’s view and in section’s name I use a link with a parameter. All works fine, except that I want the Units tab to reset chosen GET parameter to undefined.
How to do that?
Is such a construct a “nice” way to deal with such issues at all? (send scheduler’s data to get one parameter to connector) :slight_smile:

Scenario: General day scheduler of all hairdressers (Units view). When I click on a hairdresser, that particular persons week calendar is shown. When I click on month’s tab, that particular person’s month calendar is shown.
When user clicks on Unit tab, all hairdressers day calendar is shown. (I get instead that particular hairdressers info as GET parameter is still set).

            function init() {

                <?php
                    require_once("config.php");
                    $res = mysql_connect($mysql_server,$mysql_user,$mysql_pass);
                    mysql_select_db($mysql_db);

                    $sql = "SELECT res_id, name FROM b_res WHERE comp_id=6 AND olek='A'";
                    $res = mysql_query($sql);

                    echo "var sections=[";        
                    while ( $row=mysql_fetch_array($res) ) {
                        echo "{key:".$row["res_id"].", label:\"<a href='scheduler.php?res_id=".$row["res_id"]."'>".$row["name"]."</a>\"},";
                    }
                    echo "];";

                ?>

                scheduler.config.xml_date="%Y-%m-%d %H:%i";
                scheduler.xy.margin_top = 180;
                scheduler.config.details_on_create=true;
                scheduler.locale.labels.unit_tab = "Unit"
                scheduler.locale.labels.section_custom="Section";
                scheduler.createUnitsView({
                    name:"unit",
                    property:"res_id",
                    list:sections
                });

               <?php 
                    if ($_GET["res_id"])
                        echo 'scheduler.init("scheduler_here",null,"week");';
                    else
                        echo 'scheduler.init("scheduler_here",null,"unit");';

                    echo "scheduler.load('01_basic_init_connector.php?ressursi_id=".$_GET["res_id"]."');";
                    echo "var dp = new dataProcessor('01_basic_init_connector.php?res_id=".$_GET["res_id"]."');";
                ?>
                dp.init(scheduler);

Something similar to the next can be used

scheduler.attachEvent("onBeforeViewChange",function(om,od,m,d){ if (om!="unit" && m == "unit"){ //switching to the unit view scheduler.clearAll(); scheduler.load("some.php"); //url without extra param } return true; })

And I thought that it was some kind of arcane methods overriding, not documented :slight_smile:

Only nag that I have now, is that when resetting the view, mini calendar yellow markers disappear, which show some activity on that day.

Mini calendar has a method attached:

scheduler.attachEvent("onViewChange",function(){
                    scheduler.destroyCalendar(document.getElementById("mini_cal").firstChild);

                    scheduler.renderCalendar({
                        container:"mini_cal",
                        date:this._date,
                        navigation:true,
                        handler:function(date){
                            scheduler.setCurrentView(date);
                        }
                    });

                });

Try to use 2.3RC - there is a linkCalendar method, which will auto update calendar after data reloading

( or you can attach your custom handler to onXLE and call from it updateCalendar )