I want to add a button to the HeaderSpan of ListGrid in SmartGWT. I tried using the \'HeaderSpan.setAttribute((String property, Object value)) method but it did not work. Below
I'm testing it, as I need to put a Calendar in a HeaderSpan. Thanks for sharing your idea, it's of great help, although it took a while to set the correct imports.
A note : the setHeaderSpanButtons() method will only work if the datasource of the ListGrid is set. If it's not, no header at all is shown.
An improvement : you can add a break in the loop, no need to loop the whole NodeList:
if(element.getInnerHTML().toString().equals("Identification")) {
element.setInnerHTML(null);
element.insertFirst(createHeaderSpanContents());
break;
}
A question : what is the purpose of this line:
this.getAttribute("headerSpans");
And finally, it doesn't work for me - the span stays always as text "Identification". Any suggestions?
Thanks.