Thank you Jasen and Renato Back for your reply.
your ideas is works good. but in Worksheet,there are some problems
following:
1.In worksheet ervery cell has a onclick even like this:
onclick="var up = {};up['id']='75004';createWsColumn(this,
tableid,up,propertyName)"
so if i used SelectCellEditor to create checkbox in other cells,when
i click the cell the even onclick will be called.
That is not i need.So i used CheckboxWorksheetEditor to create
checkbox in toher cells,and it also used in JMesa's WorkSheet example
like this:
column.getCellRenderer().setWorksheetEditor(new
CheckboxWorksheetEditor());
2.In worksheet every checkbox has a onclick even too,like this:
<input type="checkbox" onclick="var up =
{};up['id']='75004';submitWsCheckboxColumn(this,tableid,up,property)" /
>
and this onclick even just be called when i click the checkbox(not
the head checkbox).
When this even was be called,the ajax request will be submited,and
the worksheet's state will be saved.
When i go to the nextpage then return ,the state will be restored.
But when i click the head checkbox ,even though the other checkbox
were all checked,but the onclick even was not called.
So the wordsheet's state will not be saved,when i go nextpage then
return,the state will be lost.
So in Renato Back's javascript code i insert one line code to call
the "submitWsCheckboxColumn" manually.like this:
function selectAllItens(tid) {
var table = document.getElementById(tid);
var inputs = table.getElementsByTagName("input");
var inputOption = inputs[0];
//begin on 1 to ignore the header checkbox and count only the
other ones on the table
for (var i = 1; i < inputs.length; i++){
inputs[i].checked = inputOption.checked;
//call the "submitWsCheckboxColumn" manually
inputs[i].onclick();
}
}
And now ,my problem was resolved.
Thack you again.
> 2008/3/18, Jasen <
jasen.hsu...@gmail.com>:
>
>
>
>
>
> > put a check box as the title...type the title code as this:
> > title="<input type=checkbox onclick=\"for( i=0 ;
> > i<this.form.elements.length ; i++){if
> > (this.form.elements[i].name=='idArray')
> > {this.form.elements[i].checked=this.checked;}}\"/>"
>
> > 喜欢JMesa 就多玩玩,大庭广众喊得那么激烈多不好意思呀...
> > Jasen Hsu
>
> > On Mar 18, 12:57 pm, "
tuchun...@gmail.com" <
tuchun...@gmail.com>
> > wrote:
>
> > > hello! i am a chinese developer.
> > > and i has a problem about the worksheet's checkbox.
> > > when i want to select the all checkbox of current page.i have to
> > > select checkbox one by one.
> > > i think this is a not good way. so i want to know that was there a
> > > easy way to select all checkbox of current page.
> > > example:
> > > in firstRow(the title row),i add a specified checkbox,when i
> > > select this checkbox,the other checkboxs of current page all checked.
>
> > > that's all,i hope you understand what i mean. i am not very good at
> > > English ^_^.
> > > i very like the JMesa Table.
>
>
>
> SelectHeaderEditor.java
> 1KDownload
>
> SelectCellEditor.java
> 1KDownload- Hide quoted text -
>
> - Show quoted text -