ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: logibricks on November 19, 2018, 06:08:48 pm

Title: multiline text in cell showing <br> on cell hover
Post by: logibricks on November 19, 2018, 06:08:48 pm
multiline text in cell showing <br> on cell hover mode. We have used render function for hovering on cell text.

Thanks
Aditya
Title: Re: multiline text in cell showing <br> on cell hover
Post by: paramvir on November 19, 2018, 09:28:16 pm
Aditya

Please share your implementation code so that it can be checked.
Title: Re: multiline text in cell showing <br> on cell hover
Post by: logibricks on November 21, 2018, 12:17:03 pm
render: function(ui) {
                        if (!ui.other) {
                            if(ui.rowData[ui.dataIndx] != undefined){
                            return '<span title=\'' + ui.rowData[ui.dataIndx] + '\'>' + ui.rowData[ui.dataIndx] + '</span>';
                            }
                        }
                    }
Title: Re: multiline text in cell showing <br> on cell hover
Post by: paramvir on November 21, 2018, 04:58:33 pm
Please update your render function to

Code: [Select]
render: function(ui) {
     if (!ui.other) {
           if(ui.cellData != undefined){
              return '<span title=\'' + ui.cellData.replace("\n","&#013;") + '\'>' + ui.cellData + '</span>';
           }
     }
}

As this question is not directly related to grid, but to HTML title attribute in general, please refer these links for more info:

https://stackoverflow.com/questions/18606877/how-can-i-new-newline-in-title-attribute-in-html/18612227

https://stackoverflow.com/questions/358874/how-can-i-use-a-carriage-return-in-a-html-tooltip
Title: Re: multiline text in cell showing <br> on cell hover
Post by: logibricks on November 22, 2018, 04:16:02 pm
 render: function(ui) {
                            if (!ui.other) {
                                if(ui.cellData != undefined){
                                        return '<span title=\'' + ui.cellData.replace(/\n/g,"&#013;") + '\'>' + ui.cellData + '</span>';
                                }
                            }
                        }

There is a slight change in the code provided by you. And it is Working fine.