jQWidgets Forums

Forum Replies Created

Viewing 10 posts - 106 through 115 (of 115 total)
  • Author
    Posts

  • mallepaddi
    Participant

    Problem solved … with combination of “renderer” and “rendered”.

    Thanks


    mallepaddi
    Participant

    Hi

    It’s simple, popup message should be shown when :

    Validation in on checkbox status … if user selects “checkbox” but Quantity field value is ZERO then popup should be like “Enter value ..”

    It’s all working .. but …

    When you have more rows, when you scroll and doing above action not showing popup at right place …

    var theme = ‘web’;
    var editedRows = new Array();
    var source = {
    datafields: [
    { name: ‘selected’, type: ‘bool’ },
    { name: ‘productcode’, type: ‘string’ },
    { name: ‘description’, type: ‘string’ },
    { name: ‘supplier’, type: ‘string’ },
    { name: ‘price’, type: ‘string’ },
    { name: ‘uom’, type: ‘string’ },
    { name: ‘qty’, type: ‘string’ }
    ],
    datatype: “json”,
    url: ‘Products.json’,
    id: ‘productcode’
    };

    var cellsrenderer = function (row, column, value, defaultHtml) {
    return “”;
    }

    var dataAdapter = new $.jqx.dataAdapter(source, {
    downloadComplete: function (data, status, xhr) { },
    loadComplete: function (data) {
    },
    loadError: function (xhr, status, error) { alert(‘Data load error !!!’);}
    });

    // initialize jqxGrid
    $(“#jqxgrid”).jqxGrid({
    width:’650′,
    height:’400′,
    source: dataAdapter,
    editable: true,
    theme: theme,
    selectionmode: ‘none’,
    editmode: ‘click’,
    enablehover: true,
    columns: [
    { text: ”, datafield: ‘selected’, menu: false, sortable: false, editable: true, columntype: ‘checkbox’, width: 10 ,
    renderer: function () {
    return ‘

    ‘;
    }
    },
    { text: ‘Code’, datafield: ‘productcode’, editable: false,width: 70},
    { text: ‘Description’, datafield: ‘description’, editable: false, width: 235},
    { text: ‘Supplier’, datafield: ‘supplier’, editable: false, width: 125},
    { text: ‘Price / Unit’, datafield: ‘price’, editable: false, width: 70, align: ‘right’, cellsalign: ‘right’},
    { text: ‘Qty’, datafield: ‘qty’, width: 70, editable: true, cellsalign: ‘right’, align: ‘center’, columntype: ‘numberinput’, cellsrenderer:cellsrenderer},
    { text: ‘UoM’, datafield: ‘uom’, columntype: ‘textbox’, editable: false}
    ]});

    $(“#jqxgrid”).on(‘cellvaluechanged’, function (event) {
    var row = event.args.rowindex;
    var dataField = event.args.datafield;
    var value = event.args.value
    var datarow = $(“#jqxgrid”).jqxGrid(‘getrowdata’, row);

    //if checkbox checked
    if(value === true){
    $(“#jqxgrid”).jqxGrid(‘selectrow’, event.args.rowindex);
    if (parseInt(datarow.qty) <= 0) {
    $("#jqxgrid").jqxGrid('showvalidationpopup', event.args.rowindex, "qty", "Enter Quantity for selected product.");
    }
    }
    });


    mallepaddi
    Participant

    $(window).height() helps to adjust height of grid


    mallepaddi
    Participant

    problem solved.


    mallepaddi
    Participant

    perfect,

    I have written like …

    { text: ”, datafield: ‘incart’, threestatecheckbox: false, columntype: ‘checkbox’, width: ‘5%’, renderer: function () {
    return ““;
    }
    }

    Image appearing at header level followed by ‘check boxes”

    but following event is not firing to delete selected items …

    $(“#delete”).click(function(e){ alert(‘clecked’); }

    Please help.

    Thanks


    mallepaddi
    Participant

    Thanks for your reply … just to recap … grid width and column width must be %, then validation / popup error messages disappearing when we resize screen ..

    code something like …

    $(“#jqxgrid”).jqxGrid({
    width:’100%’,
    …….
    { text: ‘Supplier’, datafield: ‘supplier’, editable: false, width: ‘15%’},
    ……..
    { text: ‘Qty’, datafield: ‘qty’, width: ‘12%’, editable: true, cellsalign: ‘right’, align: ‘center’, columntype: ‘numberinput’,
    validation: function (cell, value) {
    return { result: false, message: “Quantity entered for selected product is invalid.” };
    }
    }
    ……………..
    }


    mallepaddi
    Participant

    Hi

    Thanks for your reply, but is there a way of hiding specific popup ?

    Thanks


    mallepaddi
    Participant

    Yes, It was working as expected if we have not mentioned jgrid width:100%, If i delete width property of grid then it’s being occupying the area of targeted area so i must specify width at grid level … at the same time i would like to mention width in % not in px for grid.

    Thanks


    mallepaddi
    Participant

    Thanks again,

    Could you please recommend an alternative something like … checking checkboxk should immediately focus the control into “Quantity” field where i have validation on user input, what i need to know is switching focus from checkbox to Quantity field.

    Possible ?

    Thanks


    mallepaddi
    Participant

    Thanks for your reply, i have gone through above example before sending my request.

    But which will not be helpful in my case as my validations are based on “CheckBox” state, if “checkbox” selected and “Quantity” field empty then raise an error … i think it’s a valid scenario …

    Any work around … on validating “quantity” based on checkbox select ..

    Please advice …

    Thanks

Viewing 10 posts - 106 through 115 (of 115 total)