Forum


13:53

07/06/2009

I have been looking at jqGrid to replace a homegrown grid widget and have been very impressed with the capability of jqGrid out of the box. One of the areas where I am struggling is providing accessibility / section 508 compliance for the grid, which is a requirement for the project I am working on. Does anyone have any experience making jqGrid meet 508 requirements or making it more friendly to screen readers? Any thoughts/techniques would be greatly appreciated. For those unfamiliar with section 508, you can check out http://www.section508.gov
The two areas that seem to be noncompliant to me are:
1) keyboard equivalents for functionality provided by the mouse. Specifically i was looking at the sort functionality on the column headers and the first page, previous page, next page, last page functionality provided by the pager. Currently these items do not have onkeydown event bound to them and since they are just divs, they are not put into the default tab order for the page.
It seems like it would be easy enough to bind the key down event. I used something like the following in grid.base.js:
if( typeof sort !== 'boolean') {sort = true;}
if(sort) {
$("div",this).css("cursor","pointer")
.click(function(){sortData(this.id,j);return false;})
.keydown(function(evt){ if(evt.keyCode == 13) { sortData(this.id, j); return false; } return true; });
}
I would assume there is a similar spot that the pager elements could bind a keydown event. As far as adding the elements to the tab order of the page, the application I am working on already has functionality to reset the tab order on the page based on the user preferences so i can change that logic to add tabindex to these div elements. However from a generic grid prespective, I am curious if anyone has any ideas as to how that should be handled for other applications using the grid. In the homegrown grid being replaced the grid used anchor elements for the column labels which are automatically added to the page's tab order by the browser. I am not sure if this is a good technique or not.
2) The other issue that I see with the grid is the lack of aids for screen readers. There are several elements/attributes such as col and headers that can be used to make html tables more screen reader friendly (http://www.w3.org/TR/WCAG10-HT.....HS/#tables). However, due to the column headers being in a separate table from the actual columns the screen reader is not able to "read" the column labels when reading an associated cell. I was hopeful that I could use the header attribute on each cell to point to the id of the header cells for the grid. But this does not seem to work (at least in it does not seem to work in JAWS, i haven't tried other screen readers) as JAWS seems to ignore header attributes that point outside of the current table element. My next thought was to add an invisible column header row (thead) in the body table, however when I do this it causes a myriad of issues on top of the fact that JAWS does not read the column header unless it is visible. Has anyone else worked on making the jqGrid screen reader friendly? Any suggestions would be greatly appreciated. Thanks in advance!!
08:54

Moderators
30/10/2007

Hello,
To be a honest I hear for first time about section 508 compliance. For what I have read - this is a standart that apply only for particular Country and it is not International standart - correct me if I'm wrong. Here is what I have read:
“Section 508 refers to a statutory section in the Rehabilitation Act of 1973 (found at 29 U.S.C. 794d). Congress significantly strengthened section 508 in the Workforce Investment Act of 1998. Its primary purpose is to provide access to and use of Federal executive agencies’ electronic and information technology (EIT) by individuals with disabilities. The statutory language of section 508 can be found at http://www.section508.gov.”
What I try to do is to make jqGrid to be compatible with International standarts. Of course there is a lot to do in this direction, but I have make the first step - ARIA compatible.
http://www.w3.org/TR/wai-aria-roadmap/
I know that some things that I have made can be improved, but this is just the beginning.
1. This maybe will be done using aria standarts.
2. Yes you have maybe right, but let me say jqGrid is build to meet the user requirments first. If we use single table for the grid we can not have
- good resizing
- not good horizontal and vertical scroll
- my plans are to have frozen columns, which can not be achived with single table (at last this can be done only in IE)
At last if you look at any other grid which have such options you will see that the grid is not ony single table.
Hope that with this post we should improve the ARIA compability of the grid.
Thanks
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
12:13

07/06/2009

Tony,
Thank you for your response.
You are correct section 508 is a US standard, not an international standard. I only mentioned it because it is what is required by my project and was curious if anyone else had made changes to the jqGrid in relation to it. I absolutely agree that jqGrid should focus on the international standards.
You mentioned making the grid ARIA compatible. What do you mean exactly? Have you actually added the roles to the various elements? I didn't see this in the source, but i am very new to the jqGrid, so please be patient with me if i am asking a dumb question.
For #1
I was able to make this work with the changes below in grid.base.js. I am not sure if this is the best way to do this, but having keyboard equivalents seems reasonably useful for all users, so i thought i would pass it on. (Again, I apologize for my ignorance, but I don't know what the process is for submitting potential code changes)
sort = ts.p.colModel[j].sortable;
if( typeof sort !== 'boolean') {sort = true;}
if(sort) {
$("div",this).css("cursor","pointer")
.click(function(){sortData(this.id,j);return false;})
.keydown(function(e){ if(e.keyCode == 13) { sortData(this.id, j); return false; } return true; })
.attr('tabIndex', '');
}
$("#first, #prev, #next, #last",ts.p.pager).click( function(e) {
var cp = IntNum(ts.p.page),
last = IntNum(ts.p.lastpage), selclick = false,
fp=true, pp=true, np=true,lp=true;
if(last ===0 || last===1) {fp=false;pp=false;np=false;lp=false; }
else if( last>1 && cp >=1) {
if( cp === 1) { fp=false; pp=false; }
else if( cp>1 && cp <last){ }
else if( cp===last){ np=false;lp=false; }
} else if( last>1 && cp===0 ) { np=false;lp=false; cp=last-1;}
if( this.id === 'first' && fp ) { ts.p.page=1; selclick=true;}
if( this.id === 'prev' && pp) { ts.p.page=(cp-1); selclick=true;}
if( this.id === 'next' && np) { ts.p.page=(cp+1); selclick=true;}
if( this.id === 'last' && lp) { ts.p.page=last; selclick=true;}
if(selclick) {
if (typeof ts.p.onPaging =='function') {ts.p.onPaging(this.id);}
clearVals();
populate();
}
e.stopPropagation();
return false;
}).keydown(function(e){ if(e.keyCode == 13) { $(this).click(); return false; } return true; }).attr('tabIndex', '');
}
For #2:
I completely understand why it has to be two (or potentially more than two with frozen columns) tables. And all grid widgets that I have looked at use a similar approach of breaking up the various components of the table into different elements. They also all seem to suffer from they same issue with screen readers not being able to read the column headers. I was just wondering if there was a best practice for providing the screen reader support while maintaining the dynamicness that provides a good user experience. It looks like ARIA is the direction things are headed, but there is not much support on older browsers. My thought was to somehow add the column headers into the table in the body layer and only display it based on the user's stylesheet which would be different for those users using a screen reader versus those that are not. I don't particularly like this approach but it was the only thing i could think of. If we have the ARIA support then that seems like it would be sufficient as we could say it is supported using the proper version of the browser. Can you provide more details on what jqGrid supports now or point me in the right direction to find this information?
Thanks again for your reply!
01:44

Moderators
30/10/2007

Hello,
I see - you maybe use jqGrid 3.4.x. The things that we discuss are in 3.5 version. I think I have done 60-70 % of ARIA ready. But I want to open a disccusion about this. To be a honest I'm new tho this, so we need to improve this feature of the grid
Thanks
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
07:45

You need to be aware that although Section 508 is a US standard, there are equivalent standards in most of the world now -- e.g. the Disability Discrimination Act in the UK. There is also an ISO standard on accessibility. (I can't remember the number off hand). The 2 key basics to accessibility are 1 - everything you do with a mouse you need to be able to do with a keyboard. Thuse in the 5.4.3 grid it is impossible to select any row or use some of the "buttons" or toolbar icons without a mouse. The other major consideration is that each element needs to be able to provide information about 1. what it is, 2. what state it is in, and 3 what values it contains, and 4 what it represents in the outside world.
So 1 would mean a Button / Checkbox / Edit area / Link / Graphic etc etc, 2, Enabled / Disabled / Readonly / checked / unchecked etc. 3. The value in a field etc or for graphics what it is supplied via Alt Text . and 4 - what we would call the field prompt (label for element is the standard although most screen readers can also use the HTML title for a form field -- which for a data grid is pretty useful - since there is no room for a label generally. Also in this respect <th> table header tags are vital. Often the best way of incorporating <th> information is to use 2 tables (like you do). Where the first table contains the "visible" headers, but in the second table you can repeat these - not as HIDDEN but with say a 0 height / width (which JAWS will "see", to provide the column heading for Screen Readers to interface to.
Aria is certainly "the future" -- but given that it is only supported by IE8 and FireFox 3 at the moment and that no screen readers (even JAWS) provide a full interface to ARIA, it is not much use to many people right now. I haven't yet found an application that uses ARIA roles to see if JAWS can actually pick these up. You are also supposed to be able to do things like make elements that are not normally navigable, navigable with Aria.
I hope that helps -- I would be very happy to enter into a dialogue with you off line if you want to discuss further. I am not a big-time coder by the way -- but have a lot of practical experience in accessibility.
18:44

28/01/2010

Hi,
I initially created a new post but it seems like the same concerns were raised earlier. My concern is specifically with:
"There are several elements/attributes such as col and headers that can be used to make html tables more screen reader friendly (http://www.w3.org/TR/WCAG10-HT.....HS/#tables). However, due to the column headers being in a separate table from the actual columns the screen reader is not able to "read" the column labels when reading an associated cell. "
I used JAWS screen reader and tried to see if it reads the grid cell and the column headers. But to my surprise, JAWS is reading the first row of the grid as the column header. I am trying to figure out why it would do that. But I have not been successful so far. I also tried adding new THEAD:TH elements in the grid table but it does not work. JAWS continues to read the 1st row as the column header.
I would appreciate if you have any thoughts on this.
Most Users Ever Online: 715
Currently Online:
45 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66