jQWidgets Forums

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Input source does not work #61433

    Sandy
    Participant

    hi,
    The Source for the jqx Input and the change event doesnot work for the below code. Please help
    //script tag
    var Asso_source = {
    datatype: “json”,
    datafields: [
    { name: ‘Asso_ID’},
    ],

    url: ‘Controller/method’
    };
    var Asso_Adapter = new $.jqx.dataAdapter(Asso_source);

    $(“#Asso_ID”).jqxInput({
    placeHolder: “Enter an associate ID”,
    height: 25,
    width: 199,
    source:Asso_Adapter,
    displayMember: “Asso_ID”, valueMember: “Asso_ID”,
    theme: ‘energyblue’
    });
    $(‘#Asso_ID’).on(‘change’,

    function () {
    var v = $(‘#Asso_ID’).val();
    var url = “/controller/method”;
    $.get(url, { Emp_Id: v }, function (data) {
    $.each(data, function (i, c) {
    $(“#Asso_Name”).val() = c.Asso_Name;
    $(“Designation”).val() = c.Grade_Consolidated;
    $(“Project_ID”).val() = c.Project_ID;
    });
    });
    });
    //body
    <table id=”Asso_table” align=”center”>
    <tr align=”left”>
    <td class=”text”> Associate ID </td> <td/>
    <td id=”Asso_Input” >
    <input id=”Asso_ID” class=”Input_Box” /></td>
    <td/>

    <td class=”text”> Associate_Name </td> <td/>
    <td><input id=”Asso_Name” class=”Input_Box” disabled=”disabled” /></td>
    <td/>
    </tr>
    <tr align=”left”>
    <td class=”text”>Designation</td> <td/>
    <td><input id=”Designation” class=”Input_Box” disabled=”disabled”/></td>
    <td/>

    <td class=”text”>Project_ID</td> <td/>
    <td ><input id=”Project_ID” class=”Input_Box” disabled=”disabled”/></td>
    <td/>
    </tr>

    Input source does not work #61436

    Peter Stoev
    Keymaster

    Hi Sandy,

    The “change” event is raised on blur by the HTML Input. The only possible reason for it to not work is that there is some syntax error before your code which binds to that event. I would suggest you to test your code with the Chrome’s debugger or some other debugging tool. Other possible option is missing references to required JavaScript files.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Input source does not work #61439

    Sandy
    Participant

    Hi Peter,
    Thanks for your quick response. I would check and update. but Could you please tell me why the source is not working?

    Regards
    sandy

    Input source does not work #61443

    Peter Stoev
    Keymaster

    Hi Sandy,

    The url “Controller/method” should return JSON data. If it does, the source will work. If it does not, it will not.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Input source does not work #61445

    Sandy
    Participant

    It returns Json data .

    public JsonResult method()
    {

    var dbResult = db.ID.ToList();
    var output = from e in dbResult

    select new
    {
    e.Asso_ID,
    };

    return Json(output, JsonRequestBehavior.AllowGet);
    }
    But it is not working as it should

    Input source does not work #61473

    Peter Stoev
    Keymaster

    Hi Sandy,

    Ok, prepare and share a jsfiddle.net demo so we would be able to test your scenario, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.