We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49079
    • 12 Posts
    Hi. I want set custom window caption and window id (in DOM) for tv type MIGX . How i can do it?

    TV Type MIGX
    config:
    [{
    "fields": [
    {
    "field":"title",
    "caption":"Название"
    },{
    "field":"adult",
    "caption":"Взрослый (руб)",
    "inputTVtype":"number"
    },{
    "field":"adultWeekend",
    "caption":"Взрослый выходной (руб)",
    "inputTVtype":"number"
    },{
    "field":"child",
    "caption":"Детский (руб)",
    "inputTVtype":"number"
    },{
    "field":"childWeekend",
    "caption":"Детский выходной (руб)",
    "inputTVtype":"number"
    }
    ]
    }]
      • 44665
      • 60 Posts
      sebastian-marinescu Reply #2, 10 years, 7 months ago
      Hi artexold,

      I don't know exactly if you can adjust the title by the TV configurations only, but try adding before the line "fields":
      "caption":"My new title",


      If this doesn't work I would advice you to use the MIGX Manager Configuration Page,
      so you can easily make more advanced configurations:

      - Menu: Extras -> MIGX
      - Go to the second tab called "MIGX"
      - Create new configuration and give it a name
      - Enter Window Title
      - Set up Formtab(s) (inside this: Fields) / Columns / etc.
      - In your MIGX-TV delete all your configs and instead in "configuration" use the name of your config

      As of influencing the ID of the DOM-Element, I am not sure you can edit it. Why do you want to edit it?

      As I just explored a little you could check the ExtJS-Window-Manager and
      then somehow search for your configName and then reverse-get the DOM-Element or something:
      Ext.WindowMgr.each(function(win){console.log(win)});


      Or check the MODx-Object for its grids:
      MODx.grid


      And maybe you can somehow directly access the DOM-Element, but I haven't found out yet how...

      The documentation isn't final, but you could get some more informations from:
      - http://bruno17.github.io/MIGX/
      - https://github.com/Bruno17/MIGX/wiki
        • 44665
        • 60 Posts
        sebastian-marinescu Reply #3, 10 years, 7 months ago
        Okay, I explored a little more. That's a hacky way of getting the window's dom-element, if you only know your configuration-name:

        Ext.WindowMgr.each(function(win){
          if (win.grid.configs === "YourMigxConfigurationNameHere") {
            console.log(Ext.WindowMgr.get(win.id));
            console.log(Ext.WindowMgr.get(win.id).el);
            console.log(Ext.WindowMgr.get(win.id).el.dom);
          }
        });


        (it is not tested perfectly and I would check for 'win.grid' / 'win.grid.configs' first)

        But I really hope someone tells us both a better way smiley