jQWidgets Forums
Forum Replies Created
Viewing 5 posts - 1 through 5 (of 5 total)
-
Author
-
July 26, 2016 at 9:49 am in reply to: Cellformat based on another column value Cellformat based on another column value #86065
Thanks for the tip.
Just put it on cellsrenderer, like this:
var dataAdapter = dataAdaptersourceanlevofam; var cellclassname = function (row, column, value, data) { if (data.nome != "") { return "grayline"; }; }; $("#jqxgridanl").jqxGrid({ source: dataAdaptersourceanl, theme: 'Metro', height: 600, width: '100%', sortable: true, columnsresize: true, showaggregates: false, showstatusbar: true, statusbarheight: 25, altrows: false, showtoolbar: true, columns: [ { text: 'Family', dataField: 'family', width: 240, sortable: false, cellclassname: cellclassname }, { text: 'Year', dataField: 'year', width: 50, sortable: false, cellclassname: cellclassname }, { text: 'M1', dataField: 'm1', width: 110, align: 'right', cellsalign: 'right', sortable: false, cellclassname: cellclassname, cellsrenderer: function (row, column, value) { var valor = $("#jqxgridanlevofam").jqxGrid('getcellvalue', row,'ano'); if (valor != 'Evo') { value = $.jqx.dataFormat.formatnumber(value, 'c0'); } else { value = $.jqx.dataFormat.formatnumber(value, 'p2'); } return '<span style="margin: 4px; float: right;">' + value + '</span>';} ] });
But now I’ve got another problem, which is the currency format.
Usually I put:var localizationobj = {}; localizationobj.currencysymbol = " €"; localizationobj.currencysymbolposition = "after"; $("#jqxgridanl").jqxGrid('localizestrings', localizationobj);
after creating the grid, but now it doesn’t work as it allways puts the “$” character.
Thanks.
July 25, 2016 at 5:43 pm in reply to: Only one group column at a time Only one group column at a time #86031Thank you very much…
This is what I needed.July 21, 2016 at 3:17 pm in reply to: My Grid Grouping is ungrouping after load My Grid Grouping is ungrouping after load #85948Please close this question.
Just made it working.
I had
$("#jqxgridanl").jqxGrid('updatebounddata');
Passed to$("#jqxgridanl").jqxGrid('updatebounddata', 'cells');
Thanks.
Ok.
Just tested the example given in the demo page, and the error is the same.
Here’s my code:var estruct = { datafields: [ { name: 'name', type: 'string' }, { name: 'ly', type: 'decimal' }, { name: 'lyytd', type: 'decimal' }, { name: 'rdg', type: 'decimal' } ] }; var sourceanl = estruct; var dataAdaptersourceanl = new $.jqx.dataAdapter(sourceanl); function createanl() { $("#jqxgridanl").jqxGrid({ source: dataAdaptersourceanl, theme: 'Metro', height: 600, width: '100%', sortable: true, columnsresize: true, showaggregates: true, showstatusbar: true, statusbarheight: 25, altrows: true, showtoolbar: true, columns: [ { text: 'Name', dataField: 'name', width: 150 }, { text: 'LY', dataField: 'ly', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'c0' , aggregates: [{ '': function (aggregatedValue, currentValue, column, record) { return aggregatedValue + currentValue; } }] }, { text: 'LYYTD', dataField: 'lyytd', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'c0' , aggregates: [{ '': function (aggregatedValue, currentValue, column, record) { return aggregatedValue + currentValue; } }] }, { text: 'R/D/G', dataField: 'rdg', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'c0' , aggregates: ['sum', 'avg'] , aggregatesrenderer: function (aggregates, column, element, summaryData) { var renderstring = "<div class='jqx-widget-content jqx-widget-content-Metro' style='float: left; width: 100%; height: 100%;'>"; $.each(aggregates, function (key, value) { var name = key == 'sum' ? 'Sum' : 'Avg'; var color = 'green'; if (key == 'sum' && summaryData['sum'] < 650) { color = 'red'; } if (key == 'avg' && summaryData['avg'] < 4) { color = 'red'; } renderstring += '<div style="color: ' + color + '; position: relative; margin: 6px; text-align: right; overflow: hidden;">' + name + ': ' + value + '</div>'; }); renderstring += "</div>"; return renderstring; } ] }); var localizationobj = {}; localizationobj.currencysymbol = " €"; localizationobj.currencysymbolposition = "after"; $("#jqxgridanl").jqxGrid('localizestrings', localizationobj); }
Thanks.
Hello.
When I try the given example I get this message:
Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.
Any ideas? Thanks.
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)