Ho to Show bullet data in excel using PHPexcel ,right now instead of bullet the ul li is showing in the excel? - phpexcel

foreach ($buildAwardData as $taskValue) {
$uniCodeChar = json_decode('"\u200C"');
$dataCount = count($taskValue);
$rData = $this->createClrsRowData($header,$taskValue);
$row = $objPHPExcel->getActiveSheet()->getHighestRow()+1;
$objPHPExcel->getActiveSheet()->fromArray($rData, null, 'A'.$row);
$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':'.'E'.$row)->getAlignment()->setWrapText(true);
$count++;
}

Related

Make a radiobutton list for the stored rpivottable configuration name

The following is a link to a code that allows you to make several configuration savings, which you can load anytime as long as you don't clear your cookies.
I would like to know if it's possible to make a radiobutton, that displays a list of all the stored names.
The link:
Make several configuration saves/loadings of rpivottable on R
Here's what I've got:
save with custom name
retrieve by name
retrieve by radio button
delete by button
You may want to adjust the size or position of the radio button container. It depends on how you use it. Right now the container will continue to grow (up to a point) as you add more content.
This still uses the file or webpage name, so if you have more than one spreadsheet, you'll be able to save and keep the configurations separated.
The YAML, options, CSS, libraries, and sample data.
---
title: "testing rpivotTable cookie-ishness"
author: "me"
date: '2022-05-12'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
<style>
body { /*push content away from far right and left edges*/
margin-right: 2%;
margin-left: 2%;
}
.main-container {
max-width: unset;
}
.btn { /*Added other buttons*/
vertical-align: middle;
-moz-box-shadow: 0px 10px 14px -7px #000000;
-webkit-box-shadow: 0px 10px 14px -7px #000000;
box-shadow: 0px 10px 14px -7px #000000;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
border: .5px solid black;
display: inline-block;
font-size: 1.15em; /*Changed from 1.3em*/
padding: .3em 0px;
width: 20em; /*Changed from 18em*/
text-decoration: none; /*no underline!!*/
cursor: pointer;
}
.btn:active { /*simulate movement; added other buttons*/
position: relative;
top: 1px;
}
</style>
```{r data,include=F}
# devtools::install_github("fraupflaume/rpivotTable")
library(rpivotTable)
library(tidyverse)
data(mtcars)
```
The buttons (not radio) and rpivotTable.
## Make it Interesting...or not
Do you want to save or restore the previously saved pivot tables' configuration?
<a id='saveNamed' class='btn' style="background-color:#003b70;color:white;">Save Configuration by Name</a>
<a id='restoNamed' class='btn' style="background-color:#b21e29;color:white;">Restore Configuration with Custom Name</a>
<a id='remoSaved' class='btn' style="background-color:black;color:white;">Remove Saved Configuration</a>
```{r showMe, echo=FALSE, fig.show="hold"}
rpivotTable(mtcars, rows="am", cols = c("cyl"), width = "90%",
height = "40%", subtotals = TRUE,
rendererOptions = list(
c3 = list(legend = list(show = FALSE),
data = list(labels = TRUE),
options = list(responsive = TRUE,
maintainAspectRatio = FALSE),
size = list(width = "600",
height = "500")),
d3 = list(size = list(width = "500", height = "500"))
))
```
The remaining code is Javascript. This creates the events, saves, retrieves, and deletes configurations, and creates the radio buttons.
```{r listenOrElse,results="asis",engine="js"}
// for ONE TABLE
setTimeout(function(){ // add to buttons
radioStar(); // <= added in v3
document.querySelector('a#saveNamed').addEventListener('click', savoring);
document.querySelector('a#restoNamed').addEventListener('click', giveItBack);
document.querySelector('a#remoSaved').addEventListener('click', remIt); // removing configs
function savoring() { // function to save
el = document.querySelector('.rpivotTable');
msg = "Choose a name for the configuration that you are saving.";
inName = prompt(msg, ['Enter a name with no spaces or special characters'])
if(inName === null) {return;}; // they changed their mind; nothing saved
inName = inName.replace(/[^a-z0-9.]/gi, ''); // validate string
path = window.location.pathname.split("/").pop().split(".").slice()[0]; //filename
elId = el.getAttribute("id");
stringy = $('#' + elId).data("pivotUIOptions"); // collect rows/col filters
delete stringy['aggregators']; // remove not-parse-friendly keys
delete stringy['renderers'];
stringy2 = JSON.stringify(stringy); // one key:value pair for storage
window.localStorage.setItem(path + '_' + inName, stringy2); // STORE it!
radBuilder(inName); // <= added in v3; mod v4; add radio btn for new saved name
};
function giveItBack() { // function to regurgitate
//el = document.querySelector('.rpivotTable');
msg = "Enter the name of the configuration you would like to retrieve.";
confName = prompt(msg, ["Enter a name with no spaces or special characters"]);
if(confName === null) {return;};
confName = confName.replace(/[^a-z0-9.]/gi, ''); // validate string
retriever(confName);
}
function retriever(confName) { // <= added in v3
console.log("I'm listening! I swear!");
el = document.querySelector('.rpivotTable');
ods = [...el.ownerDocument.scripts]; // make it an array
path = window.location.pathname.split("/").pop().split(".").slice()[0]; //filename
elId = el.getAttribute("id");
where = ods.filter(function(ods){ // filter scripts for data
return ods.dataset['for'] === elId;
})[0].innerHTML;
where2 = JSON.parse(where).x.data; // format data for pivotUI()
where3 = HTMLWidgets.dataframeToD3(where2); // ...still formatting
if(window.localStorage.getItem(path + '_' + confName) === null) { // alert
len = window.localStorage.length
var str;
for(i = 0; i < len; i++) {
w = window.localStorage.key(i);
w2 = w.split("_").pop(); // remove file/page name <= changed in v3
str = str + w2 + '\n'; // make one long string of names
}
str2 = "WARNING: There is no saved pivot table configuration with the name " + confName + '.';
str2 += " Here is a list of the configuration names that are currently stored for this page:\n";
str2 += str;
alert(str2); // next step is a change in v3
giveItBack(); // when unmatched name is chosen instead of re-prompting send them back
}
gimme = window.localStorage.getItem(path + '_' + confName); // get storage
gimmeMore = JSON.parse(gimme); // prepare for recall
if(where.includes('"subtotals":true')){ // is the option 'subtotal' used?
gimmeMore.renderers = $.pivotUtilities.subtotal_renderers;
gimmeMore.dataClass = $.pivotUtilities.SubtotalPivotData;
};
if(where.includes('"tsv":true')){ // is the option 'tsv' used?
gimmeMore.renderers = $.extend(gimmeMore.renderers, $.pivotUtilities.export_renderers);
};
if(where.includes('sortAs')){
// passed as a function, they will get lost in save & retrieve
stringy = $('#' + elId).data("pivotUIOptions").sorters;
gimmeMore.sorters = stringy;
};
$('#' + elId).pivotUI(where3, gimmeMore, true, "en"); // put it back!
}
function remIt(){
el = document.querySelector('.rpivotTable');
msg = "Identify the configuration for removal.";
remName = prompt(msg, ['Enter a name with no spaces or special characters'])
if(remName === null) {return;}; // they changed their mind; nothing saved
remName = remName.replace(/[^a-z0-9.]/gi, ''); // validate string
path = window.location.pathname.split("/").pop().split(".").slice()[0]; //filename
window.localStorage.removeItem(path + '_' + remName);
rgetter = document.querySelector('#' + remName).parentNode;
rgetter.remove();
}
function radioStar() { // create container *once*; size may have to be adjusted
if(document.querySelector('#radIsland') == null) { // if an alert doesn't exist
// one time = create island for radio buttons
contLabel = document.createElement('div');
contLabel.setAttribute(
'style',
'font-size: 1.2em; font-face: bold; color: #003b70; display: flex; flex-flow: wrap row;');
contLabel.textContent = 'Choose from the available check points:';
configCont = document.createElement('div');
configCont.id = 'radIsland';
configCont.setAttribute(
'style',
'border: 1px solid #003b70; min-width: 11em; width: auto; max-width: 55em; min-height: 10em; height: auto; border-radius: .5em; color: #003b70; display: flex; flex-flow: wrap row;'
);
pEl = document.querySelector('.rpivotTable').parentNode;
pEl.prepend(configCont); // but box above rpivottable
pEl.prepend(contLabel); // put the label on top
}
radCreation();
}
function radCreation(){
// if island exists then move on
// create radio buttons; when savoring runs, radio buttons need to be rebuilt/validated?
var wk, rB, rLab, desc, newL, rCont, path, len;
path = window.location.pathname.split("/").pop().split(".").slice()[0]; //filename
len = window.localStorage.length
for(i = 0; i < len; i++) {
wk = window.localStorage.key(i);
ind = wk.lastIndexOf('_');
wkFile = wk.substr(0, ind); // remove file/page name and table number
chName = wk.split("_").pop(); // user chosen name
if(wkFile === path) { // only show radio if file names match
radBuilder(chName);
}
}
}
function radBuilder(chName){
console.log('building a button');
rB = document.createElement('input');
rB.type = 'radio';
rB.name = 'rBtn'; // only one radio w/ same name can be selected at once
rB.id = chName; // id's have to be unique for rad groups
rB.value = chName;
rB.setAttribute(
'style',
'margin: 2px;');
rB.addEventListener('click', function(){
retriever(this.value)
});
rLab = document.createElement('label');
rLab.htmlFor = chName;
desc = document.createTextNode(chName);
rLab.appendChild(desc);
newL = document.createElement('br');
fItem = document.createElement('div');
fItem.setAttribute(
'style',
'width: 10em; height: 1.1em; margin: auto;');
fItem.appendChild(rB);
fItem.appendChild(rLab);
fItem.appendChild(newL);
rCont = document.getElementById('radIsland');
rCont.appendChild(fItem);
}
}, 500);
```
If you remove a configuration, the radio button goes away, as well.
Saving a configuration will add a radio button for that configuration at that time
You can add as many configurations as you would like.
Just select a new radio to change to a different configuration.

Preserve SVG Image-Link TCPDF/FPDI & Ghostscript

In my application I utilize TCPDF to create a PDF that pastes an SVG onto it with the $link being a url that is being provided by the user so the SVG on the PDF is clickable like this
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, $pageLayout, true, 'UTF-8', false);
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set margins
$pdf->SetMargins(0, 0, 0);
$pdf->SetXY(0, 0);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 0);
// set image scale factor
$pdf->setImageScale(1);
// add a page
$pdf->AddPage();
$fullPath = "$path".'qr-code/'."$uniqname".'.svg';
// Paste SVG onto page
$pdf->ImageSVG($file=$fullPath, $x=0, $y=0, $w='', $h='', $link=$query, $align='', $palign='', $border=0, $fitonpage=true);
/* Save as File */
$pdf->Output($path.'temp/'.$uniqname.'.pdf', 'F');
I then turn this PDF into a fully black CMYK PDF using Ghostscript
$targetFile = $path.'temp/'.$uniqname.'.pdf';
$iccFile = $this->params->get('ICC_FILE');
$process = new Process(['gs', '-o', $path.'pdf/'.$uniqname.'.pdf', '-sDEVICE=pdfwrite', '-sColorConversionStrategy=Gray', '-dProcessColorModel=/DeviceGray', '-dCompatibilityLevel=1.4', '-dOverrideICC=true', "-sDefaultCMYKProfile=$iccFile", $targetFile]);
$process->run();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
And at the end I merge this PDF with another containing a Logo using FDPI like so
// create second PDF document for pasting logo
$pdf = new \setasign\Fpdi\Tcpdf\Fpdi(PDF_PAGE_ORIENTATION, PDF_UNIT, $pageLayout, true, 'UTF-8', false);
// remove default header/footer
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// set margins
$pdf->SetMargins(0, 0, 0);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, 0);
// set image scale factor
$pdf->setImageScale(1);
// add a page
$pdf->AddPage();
/* Import fullHeight page */
$pages = $pdf->setSourceFile( $path.'pdf/'.$uniqname.'.pdf', 'F' );
$page = $pdf->ImportPage( 1 );
$pdf->useTemplate( $page, 0, 0 );
if($logoselect == 'eng')
{
$logos = $pdf->setSourceFile( $path.'img/engadin_online_CMYK.pdf', 'F' );
$logo = $pdf->ImportPage( 1 );
$pdf->useTemplate( $logo, 34.25, 33.75, null, 32.5);
}
if($logoselect == 'gam')
{
$logos = $pdf->setSourceFile( $path.'img/gammetermedia_CMYK.pdf', 'F' );
$logo = $pdf->ImportPage( 1 );
$pdf->useTemplate( $logo, 34.25, 33.75, null, 32.5);
}
// Close and output PDF document
$base = $pdf->Output('qrcode.pdf', 'E');
My problem now is that the link I created on the SVG of the first PDF is not in the last PDF anymore. Is there any way I can preserve this link so that it is still clickable in the last PDF or any other way I can achieve the same result?
As requested heres the initial pdf, the ghostscript output, and the final pdf

How do if I want to make a randomize colors but with a couple set I've made with onload methode while randomizing of an occcur?

Hy, I want to make different colors every single time the page has called or opened and with the couple set I've made at the table with the different personalisation of rows color. How do I make it true ??? This line of the CSS code I've try to achieves to make some goals :
I do try with the Math methode to get random some colors but I'd stuck with it. because it won't personalisation of couple set of colors. See the code I've made with javascript at the below this :
---------------------------------------------------------- GS -----------------------------------------------------------------
function randomColor(customColorsArray, takenColorsArray) {
var text = "",
colors = ["orange", "yellow", "red", "maroon"];
if (customColorsArray && takenColorsArray) {
var text = "["+colors+"]";
}
else if (!customColorsArray && !takenColorsArray) {
text += colors[Math.floor(Math.random() * colors.length)];
}
else {
text += customColorsArray[Math.floor(Math.random() * customColorsArray.length)];
};
return text;
}
function personalRandomColor(e, customColor1, customColor2, customColor3, customColor4) {
var text = "";
if (!customColor1) {
if (e == "orange") {text += "white";}
else if (e == "red") {text += "blue";}
else if (e == "yellow") {text += "magenta";}
else if (e == "maroon") {text += "almond";};
} else {
if (e == "orange") {text += customColor1;}
else if (e == "yellow") {text += customColor2;}
else if (e == "red") {text += customColor3;}
else if (e == "maroon") {text += customColor4;};
};
return text;
}
function showTable() {
var s = SpreadsheetApp,
ss = s.getActiveSpreadsheet(),
sss = ss.getSheets(),
Html = HtmlService.createHtmlOutput(result)
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setWidth(545)
.setHeight(500),
customColorsArrays = randomColor('passingClass', 'takenColor'),
randomFirstColor = 'yellow',
skipFirstColor = customColorsArrays.replace('yellow,', ''),
randomSecondColor = randomColor(toString(skipFirstColors)),
result = "<head>
<style type='text/css'>
.gridview {
display: inline-block;
border-collapse: collapse;
margin: 0px 4px 4px 0;
box-shadow: 3px 3px 4px #bbb;
}
.gridview, .gridview td {
margin: 0;
border: 1px solid #cccccc;
}
.gridview tr:nth-child(even) {
background-color: "+randomFirstColor+";
}
.gridview tr:nth-child(odd) {
background-color: "+randomSecondColor+";
}
.gridview td {
font-weight: normal;
text-align: left;
vertical-align: middle;
}
.gridview td {
padding: 4px 10px 5px 9px;
}
</style>
</head>
<table border=1 class='gridview'>";
for (var i = 0; i < sss.length; i++) {
result += "<tr>";
result += "<td>" + sss[i].getName() + "</td>";
result += "</tr>";
}
result += "</table>";
ss.toast(customColorsArrays+" & "+skipFirstColors+" & "+randomSecondColor, "Output Test", 50);
ss.show(Html.setTitle("Show the Table at PopUp"));}
}
What I want is if the table have reloaded always shows the different colors of rows everytime the page has opened and it must be set with my personalisation I've set. Please, have a look to personalRandomColor() function In this case I would like such as Orange just for nth-child(odd) and White for nth-child(even) at the First Random Open and Red for nth-child(odd) and Blue for nth-child(even) at the Second Random Open and that's so on ... and on ... and on again and again and always again but with the condition of skipping the first colors !!!
Try this:
var colors = ["#ccff99", "#e6ffb3", "#dfff80", "#ffffcc", "#ffff99", "#ffe6ff", "#ffcccc", "#ffcc99", "#ffe6b3", "#fff0b3"];
$(document).ready({
var randomFirstColor = rando(colors);//grab a random color
colors.splice(randomFirstColor.index, 1);//remove color from array so we don't risk picking it again. you can remove this line if you don't care whether the second color is the same as the first
$(".gridview tr:nth-child(odd)").css({backgroundColor: randomFirstColor.value});//style odd rows
$(".gridview tr:nth-child(even)").css({backgroundColor: rando(colors).value});//style even rows
});
You just have to import Randojs and jQuery by pasting the following in the head tag of your html document:
<script src="https://randojs.com/1.0.0.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
OR, to exclude jQuery, try:
var colors = ["#ccff99", "#e6ffb3", "#dfff80", "#ffffcc", "#ffff99", "#ffe6ff", "#ffcccc", "#ffcc99", "#ffe6b3", "#fff0b3"];
$(window).on("load", function(){
var randomFirstColor = rando(colors);//grab a random color
colors.splice(randomFirstColor.index, 1);//remove color from array so we don't risk picking it again. you can remove this line if you don't care whether the second color is the same as the first
var randomSecondColor = rando(colors);//grab another random color
var gridviews = document.getElementsByClassName("gridview");
for(var i = 0; i < gridviews.length; i++){//for each gridview...
var rows = gridviews[i].getElementsByTagName("tr");
for(var j = 0; j < rows.length; j++){//for each row in the gridview...
if(j % 2 == 0){
//style even
rows[j].style.backgroundColor = randomFirstColor.value;
}
else{
//style odd
rows[j].style.backgroundColor = randomSecondColor.value;
}
}
}
});
You just have to import Randojs by pasting the following in the head tag of your html document:
<script src="https://randojs.com/1.0.0.js"></script>
Now that you've updated your post, I can see a problem with your code. You are assigning a string to the "result" variable, but you are breaking that string across multiple lines, like this:
var result = "example
of
bad
formatting";
You should be beginning and ending the quote on each line and adding a plus sign between them to join them together, like so:
var result = "example" +
"of" +
"good" +
"formatting";
Once you get that fixed, make sure you put the html-string you've made into an element on the page and THEN call the random row color code I've given you.

Symfony DomCrawler take all div element in html file

I want to take all element in html file.
$crawler = new Crawler($html);
for($i = 0; $i < $crawler->filter("div")->count(); $i++){
$div = $crawler->filter("div")->html();
Doing this I always take the first div element:
How can I take all div element and add in an array?
Thanks
Here is an easy way to achieve your goal:
$crawler = new Crawler($html);
$div = $crawler->filter('div')->each(function($node) {
return $node->html();
});
// Array of result = $div
// Number of result = sizeof($div)

adding tooltip to datagrid headers in dojo

I have a dojo datagrid which is poulated dynamically. I want to add tooltip to table headers of this datagrid. How can i do that?My datagrid simply has the structure of table and table headers. the fields get populated dynamically.
Thanks,
Sreenivas
Easiest Way
The easiest way, (Without overriding the template) would be to add a domNode to your layout header definition. So for example, when you are setting the "name" for your column in the layout, you can have something like ...
var layout = [
{
cells: [
{
name:"<i id="sometooltip" class='icon-large icon-edit'></i> Col",
field: "_item",
formatter: lang.hitch( this, this.formatter )
}
]
}];
What you then want to do is in your formatter, you want to check to see if "sometooltip" has be initialized as a tooltip, and do your connect.. You can use any tooltip.. not just dijit.Tooltip.
There are a few words of caution though. Because the formatter will run every time there is a redraw on your grid, you might want to think up better ways of creating your tooltip. For instance, you might want to add it to onGridRowHeaderHover, or you might want to just use CSS3 and use [title] attribute to create a CSS3 header.
Also. You can't just create the tooltip once, because the header is constantly rebuilt every redraw/change of data.
The Correct Way
The correct way would be to override the Grid template for the header, and include your tooltip in there. You would then extend the header equivalent of onStyleRow (which I can't remember), but basically the method that places the headers, and create your tooltip then.
I would definitely use the second option by overriding the template. Because otherwise you will find the grid glitchy.
For a pre-AMD Dojo version this is the monkey patch that we included in our globally scoped javascript resource. My other answer was after we switched to an AMD Dojo version.
// HeaderBuilder.generateHtml
// If showTooltips is true, the header contents will be used as the tooltip text.
var old_HeaderBuilder_generateHtml = dojox.grid._HeaderBuilder.prototype.generateHtml;
dojox.grid._HeaderBuilder.prototype.generateHtml = function(inGetValue, inValue){
var html = this.getTableArray(), cells = this.view.structure.cells;
dojox.grid.util.fire(this.view, "onBeforeRow", [-1, cells]);
for(var j=0, row; (row=cells[j]); j++){
if(row.hidden){
continue;
}
html.push(!row.invisible ? '<tr>' : '<tr class="dojoxGridInvisible">');
for(var i=0, cell, markup; (cell=row[i]); i++){
cell.customClasses = [];
cell.customStyles = [];
if(this.view.simpleStructure){
if(cell.headerClasses){
if(cell.headerClasses.indexOf('dojoDndItem') == -1){
cell.headerClasses += ' dojoDndItem';
}
}else{
cell.headerClasses = 'dojoDndItem';
}
if(cell.attrs){
if(cell.attrs.indexOf("dndType='gridColumn_") == -1){
cell.attrs += " dndType='gridColumn_" + this.grid.id + "'";
}
}else{
cell.attrs = "dndType='gridColumn_" + this.grid.id + "'";
}
}
markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true);
// content
markup[5] = (inValue != undefined ? inValue : inGetValue(cell));
// set the tooltip for this header to the same name as the header itself
try {
markup[5] = markup[5].replace("class","title='"+cell.name+"' class");
} catch(e) {
console.debug(e);
}
// styles
markup[3] = cell.customStyles.join(';');
// classes
markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : '');
html.push(markup.join(''));
}
html.push('</tr>');
}
html.push('</table>');
return html.join('');
};
I had a similar requirement. I wanted each DataGrid column header to use the name given to the column as the tooltip since our DataGrids weren't always showing the full column name due to the columns' widths sometimes being squeezed. I added a monkey patch (below) that is done with an AMD Dojo version:
require(
[
"dojo/dom",
"dojox/grid/DataGrid",
"dijit/_Widget",
"dijit/form/FilteringSelect",
"dijit/form/MultiSelect",
"dijit/layout/ContentPane",
"dijit/layout/TabContainer",
"dojox/grid/_Grid",
"dijit/MenuItem",
"dijit/MenuSeparator",
"dojox/grid/_Builder",
"dojox/grid/cells/_base",
"dojox/grid/util",
"dojo/parser",
"dojo/_base/array",
"dojo/_base/lang",
"dojo/ready",
"dojo/query",
"dijit/registry",
],
function(dom, dojox_grid_DataGrid, dijit__Widget, dijit_form_FilteringSelect,
dijit_form_MultiSelect, dijit_layout_ContentPane, dijit_layout_TabContainer,
dojox_grid__Grid, MenuItem, MenuSeparator, dojox_grid__Builder,
dojox_grid_cells__Base, dojox_grid_util,
parser, array, dojoLang, ready, dojoQuery, registry) {
var old_HeaderBuilder_generateHtml = dojox_grid__Builder._HeaderBuilder.prototype.generateHtml;
dojox_grid__Builder._HeaderBuilder.prototype.generateHtml = function(inGetValue, inValue){
var html = this.getTableArray(), cells = this.view.structure.cells;
dojox_grid_util.fire(this.view, "onBeforeRow", [-1, cells]);
for(var j=0, row; (row=cells[j]); j++){
if(row.hidden){
continue;
}
html.push(!row.invisible ? '<tr>' : '<tr class="dojoxGridInvisible">');
for(var i=0, cell, markup; (cell=row[i]); i++){
cell.customClasses = [];
cell.customStyles = [];
if(this.view.simpleStructure){
if(cell.headerClasses){
if(cell.headerClasses.indexOf('dojoDndItem') == -1){
cell.headerClasses += ' dojoDndItem';
}
}else{
cell.headerClasses = 'dojoDndItem';
}
if(cell.attrs){
if(cell.attrs.indexOf("dndType='gridColumn_") == -1){
cell.attrs += " dndType='gridColumn_" + this.grid.id + "'";
}
}else{
cell.attrs = "dndType='gridColumn_" + this.grid.id + "'";
}
}
markup = this.generateCellMarkup(cell, cell.headerStyles, cell.headerClasses, true);
// content
markup[5] = (inValue != undefined ? inValue : inGetValue(cell));
// set the tooltip for this header to the same name as the header itself
markup[5] = markup[5].replace("class","title='"+cell.name+"' class");
// styles
markup[3] = cell.customStyles.join(';');
// classes
markup[1] = cell.customClasses.join(' '); //(cell.customClasses ? ' ' + cell.customClasses : '');
html.push(markup.join(''));
}
html.push('</tr>');
}
html.push('</table>');
return html.join('');
};
}
);
Note that if there's any chance that any markup may be added to the cell.name then you'll need to add a condition that will somehow extract just the text from it to be the tooltip, or somehow generate a tooltip that won't throw a rendering error, or avoid setting a tooltip altogether for that column.

Resources