MAPView.js & MAPViewController.js

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

MAPView.js & MAPViewController.js

Jonathan Hart

Good Afternoon All,

 

Inside of MAPView.js I have added a button:

 

Using the following code:

//…

     , {

                    tooltip: 'Sync SAVED, ACTIVE MAP to SIS SSP',

                    text: '<u>Sync to Mariner SSP</u>',

                    height: 22,

                    xtype: 'button',

                     hidden:  me.currentMapPlan.get('isTemplate') == true  || 

                                     !me.currentMapPlan.get('id') ||

                                      me.currentMapPlan.get('id') == "" ||

                                     !me.authenticatedPerson.hasAccess('MAP_TOOL_SAVE_BUTTON'),

                    itemId: 'syncMarinerSSPButton'

                }

//…

 

Inside of MAPViewController.js I have added the appropriate code listener to handle the button function and it works.

I now need to HIDE the button ANYTIME a change has been made to the active MAP window… In other words, if any course is moved, added, removed and the data HAS NOT been saved, (isDirty?), then this button should NOT be displayed. 

 

I added the following highlighted code under “onCurrentMapPlanChange” listener inside of MAPViewController.js: (GREEN = WORKS, YELLOW = DOES NOT WORK)

//…

     onCurrentMapPlanChange: function(){

                var me = this;

           if(me.currentMapPlan.get('isTemplate') == true)

           {

                if((me.currentMapPlan.get('id') || me.currentMapPlan.get('id') != "") )

                {

                     me.getSaveTemplateButton().show();

                }

                me.getSavePlanButton().hide();

                me.getSaveTemplateAsButton().show();

                me.getPrintPlanButton().hide();

                //TAPS 20150142 BEGIN

                me.getView().queryById('syncMarinerSSPButton').hide(); //TAPS 20150142 Hide Sync button if plan has no ID

                //TAPS 20150142 END

                me.getShowMapStatus().hide();

                me.getPlanFAButton().hide();

                me.getShowStudentTranscript().hide();

                me.getEmailPlanButton().hide();

                me.getName().setFieldLabel("Template Title");

                me.getPlanNotesButton().setTooltip("Template Notes");

                me.getMovePlanButton().setTooltip("Move Template");

           }else{

                me.getSavePlanButton().show();

                me.getSaveTemplateAsButton().show();

                me.getSaveTemplateButton().hide();

                me.getPrintPlanButton().show();

                //TAPS 20150142 BEGIN

                if(me.currentMapPlan.isDirty(me.semesterStores)){

                     me.getView().queryById('syncMarinerSSPButton').hide(); //TAPS 20150142 Hide Sync button if plan has unsaved changes

                } else {

                     me.getView().queryById('syncMarinerSSPButton').show(); //TAPS 20150142 Show Sync button if plan does not have unsaved changes

                }

                //TAPS 20150142 END

                me.getShowMapStatus().show();

                if(me.authenticatedPerson.hasAccess('MAP_TOOL_STUDENT_FINANCIAL_AID_BUTTON'))

                     me.getPlanFAButton().show();

                else

                     me.getPlanFAButton().hide();

                if(me.authenticatedPerson.hasAccess('MAP_TOOL_STUDENT_TRANSCRIPT_BUTTON'))

                     me.getShowStudentTranscript().show();

                else

                     me.getShowStudentTranscript().hide();

                    

                me.getEmailPlanButton().show();

                me.getName().setFieldLabel("Plan Title");

                me.getPlanNotesButton().setTooltip("Plan Notes");

                me.getMovePlanButton().setTooltip("Move Plan");

           }

           me.setPlanNotesButtonIcon();

           me.getView().setLoading(false);

     },

//…

 

What am I missing?  The button DOES NOT display when it is a Template as programmed, BUT when the data has changed, the button DOES NOT hide.  How can I accomplish this desired functionality?

 

Thanks,

 

 

--
You received this message because you are subscribed to the Google Groups "Student Success Plan Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/ssp-dev/.