jqxGrid display special character &

Asked

Viewed 38 times

0

I have an intermittent error, or jqxGrid is displayed the & now he displays '&.

Even the dataAdapter, being configured as:

contentType: 'application/json; charset=utf-8'.

How can I solve this problem?

    function montarJQXGrid(jqxgrid) {
        var source = {
            type: "POST",
            cache: false,
            datatype: "json",
            url: 'CadastroProduto.aspx/BuscarProdutos',
            id: 'id',
            datafields: [
                { name: 'id', type: 'number' },
                { name: 'nomeProduto', type: 'string' },
            ]
        };
        var dataAdapter = new $.jqx.dataAdapter(source, {
            contentType: 'application/json; charset=utf-8',
            formatData: function (data) { return getFormValues(); },
            downloadComplete: function (data, textStatus, jqXHR) {
                return $.parseJSON(data.d);
            }
        });
        var localizationobj = {};
        localizationobj.emptydatastring = "Nenhum registro";
        localizationobj.loadtext = "Buscando...";
        localizationobj.sortascendingstring = "Crescente";
        localizationobj.sortdescendingstring = "Decrescente";
        localizationobj.sortremovestring = "Remover ordenação";
        $(jqxgrid).jqxGrid({
            theme: theme,
            localization: localizationobj,
            width: '100%',
            sortable: true,
            height:  '100%',
            source: dataAdapter,
            selectionmode: 'checkbox',
            columnsresize: true,
            columns: [
                { text: 'ID', datafield: 'id', columntype: 'textbox', width: 40 },
                { text: 'PRODUTO', datafield: 'nomeProduto', columntype: 'textbox', width: 180 }
                ]
        });
    }
  • please enter the code you are using along with links regarding the jqxGrid

  • I added the code to the question. For now thank you!

  • Intermittent error always happens in the same browser?

  • In Chrome and IE. It usually occurs only the first time you load the data, when you click the button again and call the search again, the error does not occur.

  • Try setting the autoencode property to true, for example: $(jqxgrid). jqxGrid({ autoencode: true, Theme: Theme,...});

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.