W3C home > Mailing lists > Public > public-html@w3.org > May 2010

Re: ISSUE-41: Creating a JavaScript DataGrid Widget

From: Steven Roussey <sroussey@gmail.com>
Date: Mon, 3 May 2010 14:36:48 -0700
Message-ID: <h2ld6971bca1005031436i67bdecc0t716b7defa680ffbc@mail.gmail.com>
To: Tony Ross <tross@microsoft.com>
Cc: "public-html@w3.org" <public-html@w3.org>
> <table id="productOrders">
> <thead>
> <tr>
>   <th
>       data-myajaxlibrary-sort="desc"
>       data-myajaxlibrary-datatype="currency"
>       data-myajaxlibrary-hidden="false">Name</th>
> </tr>
> ...
>
> And then use JavaScript like the following to create the DataGrid:
>
>     var dataGrid = new DataGrid("#productOrders");
>
> The trouble with using an attribute like "data-myajaxlibrary-datatype" is:
>
> 1) The attribute name requires a lot of typing (realize that you need
> to repeat these attributes for each table column).
> 2) There is no guarantee that there won't be a conflict with attribute
> names used by another widget. For example, multiple JavaScript
> frameworks would be tempted to use the attribute names like
> data-datagrid or data-widget- datagrid.

The first example of a data attribute is data-myajaxlibrary-sort,
which seems in conflict with the example data-datagrid. Would the
trouble in #2 not be about data-myajaxlibrary-datagrid? (Perhaps an
example like data-ms-asp4-datagrid would be more concrete.)

Assuming so, I don't see how such potential markup conflict is that
much different from global variable name conflicts in JavaScript.
While out of scope here, it seems that support for a registry of
prefixes is to support a registry for the JS globals counterparts
(which, for simplicity, ought to be the same).

>From my experience, I've seen people get out of each other's way over
time in the JS library world, and I would expect the same here.

-steve--
Received on Monday, 3 May 2010 21:37:41 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:02 UTC