jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 36 total)
  • Author
    Posts
  • in reply to: aggregates doesn’t show!! aggregates doesn’t show!! #7828

    jose Ivan
    Member

    Hi , thanks for replay again .

    Well it seems the problem is string as you told it.

    I fixed this with “parsefloat” but it weird because i try it before with static data and it works. well thanks anyway.

    in reply to: aggregates doesn’t show!! aggregates doesn’t show!! #7824

    jose Ivan
    Member

    Hi, thanks for replay.

    well thanks but i did it and show me numbers like

    $2.9460012001000004e+21
    and
    $100,002,588,000,310,000.00

    what it is am i doing wrong ?

    that my code :

    $(document).ready(function () {
    $('#SuperGrid').jqxGrid({
    width: '100%',
    editable: true, altrows: true, enablehover: true, enabletooltips: true,
    enableanimations: true, keyboardnavigation: true, autoheight: true, pageable: false,
    columnsresize: true, theme:'classic',
    editmode: 'selectedcell',selectionmode: 'singlecell',
    showstatusbar: true, statusbarheight: 50, showaggregates: true,
    ready: function () {
    $('#SuperGrid').jqxGrid('selectcell', 0, 'acc');
    $('#SuperGrid').jqxGrid('wrapper').focus();
    },
    columns:
    [
    { text: '', columntype: 'checkbox', width: 40, datafield: 'ready'},
    { text: 'acc', dataField: 'acc', width: 100 },
    { text: 'credit',datafield: 'credit', width: 100 ,cellsalign: 'right', cellsformat: 'c2',
    symbolPosition: 'left',
    aggregates:[{'total_credit': function(Value, currentValue, column, record) { return currentValue+ Value } }],
    aggregatesrenderer :function(aggregates) {
    var renderstring = aggregates['total_credit'];
    return '' + renderstring + '';
    }
    },
    { text: 'debit',datafield: 'debit', width: 100 ,cellsalign: 'right', cellsformat: 'c2',
    symbolPosition: 'left',
    aggregates: [{'total_debit': function(Value, currentValue, column, record) { return currentValue+ Value } }],
    aggregatesrenderer :function(aggregates) {
    var renderstring = aggregates['total_debit'];
    return '' + renderstring + '';
    }
    },
    { text: 'notes', dataField: 'notes', width: 100 },
    { text: 'proyecto', dataField: 'proyecto', width: 100 }
    ]
    }); //fin del Grid
    }); //document ready

    in reply to: aggregates doesn’t show!! aggregates doesn’t show!! #7819

    jose Ivan
    Member

    And

    var dataAdapter = new $.jqx.dataAdapter(source);
    $(‘#SuperGrid’).jqxGrid({ source: dataAdapter });

    in reply to: Test Topic Test Topic #7818

    jose Ivan
    Member

    Hi, thanks for replay.

    well thanks but i did it and show me numbers like

    $2.9460012001000004e+21
    and
    $100,002,588,000,310,000.00

    what it is am i doing wrong ?

    that my code :

    $(document).ready(function () {
    $('#SuperGrid').jqxGrid({
    width: '100%',
    editable: true, altrows: true, enablehover: true, enabletooltips: true,
    enableanimations: true, keyboardnavigation: true, autoheight: true, pageable: false,
    columnsresize: true, theme:'classic',
    editmode: 'selectedcell',selectionmode: 'singlecell',
    showstatusbar: true, statusbarheight: 50, showaggregates: true,
    ready: function () {
    $('#SuperGrid').jqxGrid('selectcell', 0, 'acc');
    $('#SuperGrid').jqxGrid('wrapper').focus();
    },
    columns:
    [
    { text: '', columntype: 'checkbox', width: 40, datafield: 'ready'},
    { text: 'acc', dataField: 'acc', width: 100 },
    { text: 'credit',datafield: 'credit', width: 100 ,cellsalign: 'right', cellsformat: 'c2',
    symbolPosition: 'left',
    aggregates:[{'total_credit': function(Value, currentValue, column, record) { return currentValue+ Value } }],
    aggregatesrenderer :function(aggregates) {
    var renderstring = aggregates['total_credit'];
    return '' + renderstring + '';
    }
    },
    { text: 'debit',datafield: 'debit', width: 100 ,cellsalign: 'right', cellsformat: 'c2',
    symbolPosition: 'left',
    aggregates: [{'total_debit': function(Value, currentValue, column, record) { return currentValue+ Value } }],
    aggregatesrenderer :function(aggregates) {
    var renderstring = aggregates['total_debit'];
    return '' + renderstring + '';
    }
    },
    { text: 'notes', dataField: 'notes', width: 100 },
    { text: 'proyecto', dataField: 'proyecto', width: 100 }
    ]
    }); //fin del Grid
    }); //document ready
    in reply to: aggregates doesn’t show!! aggregates doesn’t show!! #7806

    jose Ivan
    Member

    Hi, thanks that’s works but the sum show me $ 0 , i can figure out that’s because when it built doesn’t have datasource , if you see i set the datasource in callback. How can i update this values?

    thanks for replay.

    in reply to: aggregates doesn’t show!! aggregates doesn’t show!! #7723

    jose Ivan
    Member

    i got the 2.4.1 v

    in reply to: Test Topic Test Topic #7714

    jose Ivan
    Member

    thanks for reply.

    The only way that i could do it was write the javascript from codebehid in C#,

    $(“#SuperGrid”).jqxGrid(
    {
    width: 670,
    source: dataAdapter,
    theme: theme,
    columnsresize: true,
    ready: function () {
    },
    columns: [
    { text: ‘avarible’, datafield: ‘avarible’, width: 250 }
    {other columns from datatable …….}
    ]
    });

    i just write just the columns and then with $.ajax add fields to source.datafields dynamically

    $.ajax({
    type: ‘POST’,
    url: URl,
    data: data ,
    contentType: ‘application/json; charset=utf-8’,
    dataType: ‘json’,
    success: sucessokey,
    error: error
    });

    function sucessokey(result) {

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘avarible’ },
    ]
    };
    var respuesta = $.parseJSON(result.d);
    source.localdata = respuesta.result.Table;
    var cantidad = respuesta._columnInfos.length;

    for (var i = 0; i < cantidad; i++) {
    var fila = respuesta._columnInfos[i];
    gridColumns.push({ text: fila.hearder, dataField: fila.datafield, cellsalign: ‘left’, width: 120 }); //add a column
    }
    cantidad = respuesta._datas.length;
    for (var i = 0; i < cantidad; i++) {
    source.datafields.push({ name: respuesta._datas[i].datafields });// add a new datafield
    }

    var dataAdapter = new $.jqx.dataAdapter(source);
    $(“#SuperGrid”).jqxGrid({ source: source });
    }


    jose Ivan
    Member

    That’s true !! this behavior comes from 2.4.0. I got something similar… when i clear seleccion all my checkbox change state to check. i think that checkbox.js change the logic internal.


    jose Ivan
    Member

    jquery v1.7.2 . I found the problem…
    $(migrid.grid).jqxGrid({ selectionmode: ‘singlecell’ });

    this happen when i change the selectionmode, i got the feature the select multiples rows, this for delete the rows selected, but in the event cellclick i change the selectionmode to single $(migrid.grid).jqxGrid({ selectionmode: ‘singlecell’ }); and then no display with the mouse.

    i got the code… the function getFistCheckboxColumn get the first datafield that ‘s a check column so when i change the value i set the selectionmode=’multiplerows’ and when i select a any cell i change the selectionmode to singlecell…

    { text: ‘Fila’, columntype: ‘checkbox’, width: 10, datafield: ‘ready’, cellbeginedit: isCellEditable },

    $(migrid.grid).bind(“cellclick”, function (event) {
    $(migrid.grid).jqxGrid({ selectionmode: ‘singlecell’ });
    migrid.selectionmode = ‘singlecell’;
    });

    $(migrid.grid).bind(‘cellendedit’, function (event) {
    if (event.args.datafield == migrid.getFistCheckboxColumn()) {
    $(migrid.grid).jqxGrid({ selectionmode: ‘multiplerows’ });
    if (event.args.value) {
    $(migrid.grid).jqxGrid(‘selectrow’, event.args.rowindex);
    }
    else {
    $(migrid.grid).jqxGrid(‘unselectrow’, event.args.rowindex);
    }
    }
    });

    so if i remove the line $(migrid.grid).jqxGrid({ selectionmode: ‘singlecell’ }); everything works fine!!


    jose Ivan
    Member

    ahh never mind it’s javascript sorry “the answer is yes u can !!” my bad thanks!!!


    jose Ivan
    Member

    Thanks 4 reply… but the createeditor doesn’t work!! in a grid, i’m using the version 2.0 . if i use the initeditor the list appears just only with the keyboard ! no the click.


    jose Ivan
    Member

    Hi thank for reply …. mmm i was thinking in this solution….. i had to add a field call isClient hidden of type bool so in document ready i set false and then i thought cancell the edition it’s isClient is false with this line $(grid).jqxGrid(‘endcelledit’, row, ‘jobid’, false); but as result this i think the remove the editor so when initeditor finish and come back at your script this make a error in jxgrid.editor in line
    g.css(“display”, “block”);
    this.editcell.editor = g

    so i decide create a property in grid call lasroweditable =false so just only when it the last row and then field is that i want let editable

    this.addHandler(this.host, “keydown.edit” + this.element.id, function (g) {
    var f = true;
    if (d.editable && d.editmode != “programmatic”) {
    if (d._handleeditkeydown) {
    var cel = d.getselectedcell();
    if ((d.noteditable.indexOf(cel.datafield) == -1 || d.getrowdata(cel.rowindex)[d.source._source.id] == 0) && d.lastrowEditable == false)
    f = d._handleeditkeydown(g, d)

    }
    }

    noeditable is a list of fields no editable so i search it and it isn’t no contains u can edit. maybe it’s not the most engine solution but it works…

    in reply to: DropdownList in a Grid? DropdownList in a Grid? #3772

    jose Ivan
    Member

    Hi Again!! so this is the solution but i got a other trouble..

    var jobsList = [
    { "jobID": "1", "text": "Proyecto 1" },
    { "jobID": "2", "text": "Proyecto 2" },
    { "jobID": "3", "text": "Proyecto 3" },
    { "jobID": "4", "text": "Proyecto 4" }
    ];

    var dropDownListSource =
    {
    localdata: jobsList, datatype: "json",
    datafields: [
    { name: 'jobID' },
    { name: 'text' }
    ],
    id: 'jobID'
    //url: url
    };

    var dropdownListAdapter = new $.jqx.dataAdapter(dropDownListSource, { autoBind: true, async: false });
    $(grid).jqxGrid(
    {
    width: 1000,
    source: dataAdapter,
    editable: true, altrows: true, enablehover: true, enabletooltips: true,
    enableanimations: true, keyboardnavigation: true, autoheight: true, pageable: false, columnsresize: true,
    columnsresize: true, theme: theme,
    editmode: /*'programatic', //*/'selectedcell',
    selectionmode: 'singlecell',
    columnsFilter: ['Account'],
    DataSources: [CuentasDisponibles],
    columns: [
    { text: 'fila', columntype: 'checkbox', width: 50, datafield: 'ready' },
    { text: 'id', columntype: 'textbox', datafield: 'id', width: 50 },
    { text: 'notas', datafield: 'nota', columntype: 'textbox', width: 250 },
    { text: 'Proyecto', columntype: 'dropdownlist', datafield: 'jobID', width: 250,
    validation: function (cell, value) {
    var validation = GetFieldInList(jobsList, 'text', value.toString());
    if (validation.length != 1) {
    return { result: false, message: "Seleccione un registro..." };
    }
    return true;
    },
    initeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: 'text', valueMember: 'jobID', source: dropdownListAdapter });
    }
    },
    { text: 'Rubro', columntype: 'dropdownlist', datafield: 'classID', width: 250,
    initeditor: function (row, cellvalue, editor) {
    editor.jqxDropDownList({ displayMember: 'text', valueMember: 'classID', source: dropDownListClassSource });
    }
    }
    ]
    }); //fin del Grid

    the columns rendered but when i wanna edit i have to press any key and i see the example that u have jus 2 clicks edit the first to select the cell and the second to edit… and dropdown the list but i doesn’t work.

    in reply to: DropdownList in a Grid? DropdownList in a Grid? #3725

    jose Ivan
    Member

    yeah but how in the dropdownlist not exists something like {id:’idfield’,display:’mifield’ , datasource:’my datasource’} ? how can i map the id with the text ? in the example above the field jobID and classID are foreign so use the render cellsrenderer to display the text foreach id but when in var Jobenderer the value is equals “” so my function just return the first for each row ,i need to display the text but in my dataAdapter these columns are number ?

    if you see the variable row ={……..,”jobID”: “1”, “classID”: “4”}

    so i want to display the text for each column
    var jobsList = [
    { “jobID”: “1”, “text”: “Proyecto 1” }
    ]
    var classList = [
    { “classID”: “4”, “text”: “Rubro 4” }
    ]

    so in my Grid
    ………
    Column: [
    { text: ‘Proyecto’, columntype: ‘dropdownlist’, datafield: ‘jobID’, width: 250, cellsrenderer: Jobenderer },
    { text: ‘Rubro’, columntype: ‘dropdownlist’, datafield: ‘classID’, width: 250, cellsrenderer: classrenderer }
    ]
    so i mapped these fields in rendecell and when finish these don’t show until a move the scroollbar…. i have a idea and i’m gonna try maybe in gridcomplete maybe i can do this… it’s results i’m gonna publish for all the people that have the same problem .

    Thanks for reply.


    jose Ivan
    Member

    that’s awesome … it works for me that ‘s was looking for…. thanks…

Viewing 15 posts - 16 through 30 (of 36 total)