jQWidgets Forums

jQuery UI Widgets Forums Grid use symbol in the cell

This topic contains 3 replies, has 2 voices, and was last updated by  mustafa 10 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • use symbol in the cell #66917

    mustafa
    Participant

    hello
    How do I show this symbol in the cell? %

    I used it but did not

     var localizationobj = {};
    
        localizationobj.percentsymbol = "%";
        localizationobj.currencysymbol = "€";
    
     $("#InvoiceItemGrid").jqxGrid(
        {
            width: '72.3%',
            source: dataAdapter,
            editable: true,
            height: '300px',
            altrows: true,
            showaggregates: true,
            showstatusbar: true,
            showtoolbar: true,
            //selectionmode: 'singlerow',
            //editmode: 'selectedrow',     
            statusbarheight: 50,
            rendertoolbar: toolbarfunc,
            columns: [
                {
                    text: "Invoice Item", width: '40%', datafield: "InvoiceItemID", columntype: 'dropdownlist', createeditor: function (row, column, editor) {
                        editor.jqxDropDownList({ source: invoiceItemsData, displayMember: "Name", valueMember: "InvoiceItemID", promptText: "Please Select Item:" });
                    },
                    cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
                        if (newvalue == "") return oldvalue;
                    }
                },
    
                      { text: 'Amount', datafield: 'Amount', width: '20%', cellsformat: 'c2', aggregates: ['sum', 'avg'] },
                      { text: 'VAT', datafield: 'VAT', width: '20%', },
                      {
                          text: 'Total', datafield: 'Total', width: '20%',cellsformat: 'c2', columntype: 'numberinput',
                          initeditor: function (row, cellvalue, editor) {
                              editor.jqxNumberInput({ digits: 2 });
                          }, cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
                              var total = parseFloat(rowdata.Amount) * parseFloat(rowdata.VAT) / 100 + parseFloat(rowdata.Amount);
                              if (isNaN(total)) {
                                  total = 0;
                              }
                              return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(total, "c2") + "</div>";
                          },
                          aggregates: ['sum', 'avg', {
                              '<br /><b>Total</b>':
                              function (aggregatedValue, currentValue, column, record) {
                                  return aggregatedValue;
                              }
                          }],
    
                      }
            ],
    
        });
    
      $("#InvoiceItemGrid").jqxGrid('localizestrings', localizationobj);

    and end question
    How do I use dynamic localizationobj?
    When I select combo exchange I want to change this
    it’s possible ?

                                                               
      return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(total, "c2") + "</div>";

    I tried it but it did not work
    return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(total, "+localizationobj+") + "</div>";`

    use symbol in the cell #66965

    Peter Stoev
    Keymaster

    Hi mustafa,

    If you want to use multiple currency types, you can set the Grid’s localization property to Localization objects dynamically or you can implement your current column’s cellsrenderer function.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    use symbol in the cell #67040

    mustafa
    Participant

    hi peter
    Thanks for the reply
    but I do not want to use by country
    I just want to show symbol rate
    If you think I do not understand please you give me examples?
    and

    How can I use special characters in the cell?
    I just want to show it in the cell “%”
    for taxes
    example
    numberInput : %5

    thank you

    use symbol in the cell #67043

    mustafa
    Participant

    hi peter
    I’ve tried it
    I’ve tried it I see the symbol, but I see symbol but I do not see I am enter number

     var renderer = function (row, columnfield, value, defaulthtml, columnproperties) {
    
            return '<span>%</span>';
        }

    { text: 'TAX', datafield: 'TAX', width: '20%', cellsformat: 'c2', aggregates: ['sum', 'avg'], cellsrenderer: renderer },

    and

    I just want to change the symbol in the cell and bottom total
    Can I do with the cellsrenderer?
    thank you

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

You must be logged in to reply to this topic.