form.reloadOptions() is not working

Hi,

I have a form with the following structure:

    dhxLUWin = dhxWins.createWindow({
        id:"linkuserwin",
        left:20,
        top:75,
        width:350,
        height:230,
        modal:false,
        resize:false,
        center:true,
        header:true,
        caption:"Link RADAR Users to Account"
    }); 
    
    dhxLUWin.attachEvent("onClose", function(win){
        win.hide();
        return false; //never close the window. because we dont want to slow syste mby recreating the dialog formThe following static form is loaded here        
    });
    dhxLUWin.button("minmax").hide();
    dhxLUWin.button("park").hide();
    wpos = dhxLUWin.getPosition();
    dhxLUWin.setPosition(wpos[0],75);
    //dialog form for the System access popup
    dhxLayoutLU = dhxLUWin.attachLayout({
    pattern: "1C",
    cells: [{id: "a",  header: false}]
    });
    dhxFormLU = dhxLayoutLU.cells("a").attachForm();
    LUFormData = [
        {type: "settings", labelWidth: 250, offsetLeft: 30},
        {type: "combo", name: "nonaccombo", label:"Select RADAR Users", comboType: "checkbox",filtering:true,readonly:true, options:[

        ]},
        {type: "button", name: "submit", value: "Add Selected Users", inputLeft:75, inputTop:65, position:"absolute"},
    ]
    dhxFormLU.loadStruct(LUFormData);
    dhxLUWin.hide();

Everytime the window(dhxLUWin) is shown, the form options are to be refreshed from the server. The function that does this is shown below

        function linkOtherUsers(){
            dhxLUWin.show();
            dhxLayoutLU.cells("a").progressOn();
            window.dhx4.ajax.post("/app/ajax_admin/<?=$account->id?>", "mode=getusercomboxml", function(response){
                dhxFormLU.reloadOptions("nonaccombo", response.xmlDoc.responseXML); //loads non account users into combo async
                dhxLayoutLU.cells("a").progressOff();
            });             
        };

I can see the network response of the xml(screenshot) but the combo options are not getting reloaded with the new options received(its blank). Any idea what could be wrong? I am using the latest PRO version of the dhtmlx framework.


Basically I’m just trying to have a combo with checkboxes for its options which needs to be dynamically populated each time the dhtmlx window popup is shown. Please help guys…

Hi

Could you please provide us complete demo including all correspondnig js/css files?
Please also add information regarding current and expected behaviour.

Here is a small guide how to make a complete demo:
docs.dhtmlx.com/tutorials__auxil … pport.html

If you don’t want to share your demo here for any reasons - you can send it to support@dhtmlx.com, if so - please include link to this forum topic.

If you’re using PRO Edition please send your demo to support@dhtmlx.com

Hi Andrei,

I have sent the saved page to the email you mentioned (the link of this topic is there in the email). The issue is its part of a complex view system which will not work on its own. So the best I could get is the saved page. The problem is in the combo where the dropdown does not work(clicking on it does not open up the combo options like it should. nor the dhxFormLU.reloadOptions(“nonaccombo”, response.xmlDoc.responseXML); reloads the options received from the server in the xml format for the combo. Any help is highly aprpeciated.

Got it resolved finally.
It was reloadOptions() that was causing the issue.

Changed the server response to json instead of the xml
and changed the function like this

        function linkOtherUsers(){
            dhxLUWin.show();
            dhxLayoutLU.cells("a").progressOn();
            window.dhx4.ajax.post("/app/ajax_admin/<?=$account->id?>", "mode=getusercomboxml", function(response){
                dhxFormLU.reloadOptions("nonaccombo", window.dhx4.s2j(response.xmlDoc.responseText)); //loads non account users into combo async
                dhxLayoutLU.cells("a").progressOff();
            });             
        };

Hi

sorry for the late response. seems like you already solved your question?