jQWidgets Forums

Forum Replies Created

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts

  • claudegel
    Participant

    Thanks it work perfectly


    claudegel
    Participant

    Thanks will take a look and let you know


    claudegel
    Participant

    sorry there was a typo error in my previous post

    page code source is like this:

    
    $(document).ready(function () {           
                    // Create a jqxDateTimeInput
                    $("#date").jqxDateTimeInput({width: "250px", height: "25px", theme: "Arctic", formatString: "yyyy-MM-dd", selectionMode: "range", showFooter: true, todayString: "Aujourd'hui"});
                    $("#date").jqxDateTimeInput('setRange', "2015-01-15", "2015-01-17");
                    $("#date").on('change', function (event) {
                        var selection = $("#date").jqxDateTimeInput('getRange');
                            document.getElementById('debut').value = selection.from.toLocaleDateString();
                        	document.getElementById('fin').value = selection.to.toLocaleDateString();
                    });
    
                });
    

    date range passed to the calendar is ok but it is offsetted by on day in the calendar field


    claudegel
    Participant

    Now that it’s working what should I do if the mysql result is empty
    does it cause an error with json_encode or should I send something else in order to not crash on the java side


    claudegel
    Participant

    I’ve found the solution

    while($r = mysql_fetch_assoc($result)) {
    $resultat[] = $r;
    }
    echo json_encode($resultat);

    very simple, in case other need to know

    Thank you

    in reply to: multiple dataAdapter in one page multiple dataAdapter in one page #64802

    claudegel
    Participant

    Ok, do I need to give a different var name and source name for each one like
    var dataAdapter = new $.jqx.dataAdapter(Source);
    var dataAdapter2 = new $.jqx.dataAdapter(Source2);

    so they can have a different behavior if needed ?

    and to activate them I just need to include them in a event driven function to togle them on/off ?

    Thanks,

    in reply to: generic php search engine generic php search engine #64744

    claudegel
    Participant

    Ok sorry but I’ve finally found that the bug was in my php script sending a bad json encoded data
    but I still don’t know how to solve it. So I<ve moved my question to the dataAdapter section.
    The scrip is working if I’m sending back a know number of mysql table field data. But I need to have a php script that can handle a variable number of mysql table field data to send back via json_encoded.
    fixed number of data field work great but trying to handle a variable number of field data do not work and send corrupted json data.
    see my post in data Adapter section

    Thanks

    in reply to: generic php search engine generic php search engine #64741

    claudegel
    Participant

    OK now it work I can send request to the engine and get data back with the possibility to filter data on demand. My problem now is the data I<m getting back from the search engine do not show up in the dropdown list. It look like the number of item in the dropdown list is correct but I only get blanck item in the list

    the data I get back is in this state:
    [[“nom=>Yvan Perreault et Fils qc Inc.,nocli=>227-1”],[“nom=>Yvan Perreault et Fils Inc.,nocli=>227”],[“nom=>…..
    …..,[“nom=>john doe,nocli=>612”]]

    my code is like this in the index.php:

    var url = “../engine/index.php”;
    // prepare the data
    var source =
    {
    datatype: “json”,
    type: “POST”,
    datafields: [
    { name: ‘nocli’ },
    { name: ‘nom’ }
    ],
    url: url,
    async: false,
    data: {
    select: true,
    dbase: “client”,
    nbfield: 2,
    numrow: “*”,
    filtre: “-“,
    ordre: “nom desc”,
    field: [‘nom’, ‘nocli’]
    }
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    // Create a jqxDropDownList
    $(“#jqxWidget”).jqxDropDownList({
    selectedIndex: 0, source: dataAdapter, displayMember: “nom”, valueMember: “nocli”, width: 200, height: 25
    });
    $(“#jqxWidget”).jqxDropDownList({placeHolder: “Choisir:”});
    // subscribe to the select event.
    $(“#jqxWidget”).on(‘select’, function (event) {
    if (event.args) {
    var item = event.args.item;
    if (item) {
    var valueelement = $(“<div></div>”);
    valueelement.text(“Value: ” + item.value);
    var labelelement = $(“<div></div>”);
    labelelement.text(“Label: ” + item.label);
    $(“#selectionlog”).children().remove();
    $(“#selectionlog”).append(labelelement);
    $(“#selectionlog”).append(valueelement);
    }
    }
    });

    something should be missing to have the data showing up in my dropdown list

Viewing 8 posts - 16 through 23 (of 23 total)