Re: ISSUE-41: Creating a JavaScript DataGrid Widget

> <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