Announcement

Collapse
No announcement yet.

Miva 9 Bartch Screens (like Categories)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Wow I was soooo close to figuring this out. Thanks.
    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    Comment


      #17
      Bit by bit I'm getting there. The Product and Category admin screens have a dropdown options for "Show Products" and "Show Categories." When Map Location successfully geolocates an address, it marks the record active.

      I have created the dropdown for "Show Maps" with options "All, Unmapped and Mapped" but does not do anything yet other than display. I'm seeking guidance on how to go about this.

      Here is what I have so far. Inside function Gmap_List() I added.
      Code:
      this.filter_map_show                = 'All';
      this.button_map_show                = this.Feature_Buttons_AddButton_Persistent_Dropdown( '', 'Show Maps', 'list' );
      this.button_map_show_all            = this.button_map_show.Menu_Append_Item_Toggle( 'All',            function( event, data, active ) { self.Map_Show( 'All' ); },        null );
      this.button_map_show_unmapped        = this.button_map_show.Menu_Append_Item_Toggle( 'Unmapped',        function( event, data, active ) { self.Map_Show( 'Unmapped' ); },    null );
      this.button_map_show_mapped            = this.button_map_show.Menu_Append_Item_Toggle( 'Mapped',        function( event, data, active ) { self.Map_Show( 'Mapped' ); },        null );
      Looking at BaseCategoryList.prototype.Construct and BaseProductList.prototype.Construct

      It looks like I have to either...
      Create a seperate Gmap_List.prototype.Construct and then add all of the other prototype functions like Category_Show_SetActive, OnSearch_GetFilter_AddHook, and so on.
      Or...
      Continue constructing everything inside Gmap_List().

      Either way I think I have to construct the prototype functions like Category_Show_SetActive etc. and hook this back into the search function.

      Before I spend time too much time, Is this the correct path or is there another way that already provided?
      Ray Yates
      "If I have seen further, it is by standing on the shoulders of giants."
      --- Sir Isaac Newton

      Comment


        #18
        I am writing vis_cust module and I want to get customer address data for currently selected customer. What variable holds current customer id and how do I pass this to batchlist_load_query and how do I get the data from this query.

        Thank you.
        Daniel Kim, Compu-Mate
        Developer

        Comment


          #19
          Originally posted by compumate99 View Post
          I am writing vis_cust module and I want to get customer address data for currently selected customer. What variable holds current customer id and how do I pass this to batchlist_load_query and how do I get the data from this query.

          Thank you.
          Using a combination of Brennan's post above with the link to the batchlist pdf documentation (http://www.miva.com/pdf/mmbatchlist.pdf -- Read this if you're planning on doing anything with MMBatchList. It will help you understand MMBatchList and how it functions before you go about trying to use and modify it) and modules/shipping/wtbship/chargelist.js in the MMLSK, you should be able to get where you need to go. When on the edit customer screen, you have access to the customer id in JS via MMScreenContext.customer.id, which you would pass to your batch list when you initialize it.
          Ryan Guisewite
          Lead UI Developer / Miva, Inc.
          www.miva.com

          Comment


            #20
            I still have some basic questions never mentioned in pdf file.
            1. JS files will be included in module executable, is it correct?
            2. How do I pass parameter to batchlist_load_query function in function.js from my batchlist.js?
            Daniel Kim, Compu-Mate
            Developer

            Comment


              #21
              Originally posted by compumate99 View Post
              I still have some basic questions never mentioned in pdf file.
              1. JS files will be included in module executable, is it correct?
              Correct. You need to implement the "clientside" feature and use function Module_Clientside. If you need more information on this feature, see http://www.miva.com/apiguide and/or look at examples of this being implemented in any of the modules in the LSK that have that feature (wtbship,mv as an example). Keep in mind that we have the option of using combined/minified versions of our JS files and that you can choose to do that as well, or not. The Module_Clientside implementations in the LSK will show the combined/minified way of doing it.

              Originally posted by compumate99 View Post
              2. How do I pass parameter to batchlist_load_query function in function.js from my batchlist.js?
              If you look at my last comment about modules/shipping/wtbship/chargelist.js, this shows how to pass the extra parameter. Just follow the function calls down the line. chargelist.js's onLoad function passes the extra product_id parameter to the Load_Query function (wtbship/functions.js), which shoots off an AJAX call to our JSON handler, which then calls into Module_JSON for your module, etc etc.
              Ryan Guisewite
              Lead UI Developer / Miva, Inc.
              www.miva.com

              Comment


                #22
                If you are going to use the Ajax features (as opposed to the traditional method of submitting form data) then you will also need to implement the "json " feature and add the function Module_JSON()

                Code:
                <MvFUNCTION NAME="Module_JSON" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
                    <MvFUNCTIONRETURN>
                </MvFUNCTION>
                Last edited by RayYates; 07-25-16, 08:32 AM.
                Ray Yates
                "If I have seen further, it is by standing on the shoulders of giants."
                --- Sir Isaac Newton

                Comment


                  #23
                  Thanks Ryan,

                  All the subfolders of modules/shipping folder are missing from LSK.
                  Daniel Kim, Compu-Mate
                  Developer

                  Comment


                    #24
                    Ah, that is apparently something that has not made it into the released LSK yet.

                    In your JavaScript list, you should have the following:

                    Code:
                    compumate99_list.prototype.onLoad = function( filter, sort, offset, count, callback, delegator )
                    {
                        // this.customer_id would be passed in as a constructor parameter (MMScreenContext.customer.id) to your list and then saved to this.customer_id for later use, ie... here
                    
                        compumate99_list_Load_Query( this.customer_id, filter, sort, offset, count, callback, delegator );
                    }
                    in your functions.js file, you'd have

                    Code:
                    function compumate99_list_Load_Query( product_id, filter, sort, offset, count, callback, delegator )
                    {
                        return AJAX_Call_Module( callback,
                                                 'admin',
                                                 'compumate99',
                                                 'compumate99_listList_Load_Query',
                                                 'Customer_ID='    + encodeURIComponent( customer )    +
                                                 '&Filter='        + EncodeArray( filter )                +
                                                 '&Sort='        + encodeURIComponent( sort )        +
                                                 '&Offset='     + encodeURIComponent( offset )        +
                                                 '&Count='         + encodeURIComponent( count ),
                                                 delegator );
                    }
                    And now you have g.Customer_ID available in your module's JSON function. You would, of course, replace the function names, module names, etc above from compumate99 to whatever they actually are in your module.
                    Ryan Guisewite
                    Lead UI Developer / Miva, Inc.
                    www.miva.com

                    Comment

                    Working...
                    X