question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename DataView's `getItem()` to `getRow()`

See original GitHub issue

It’s a bit confusing that getItem() appears to operate on the same data set as setItems() addItem(), updateItem() and deleteItem(), which it actually does not. Especially confusing that there is a getItems() that does operate on the same data set.

In fact, getItem() retrieves a “row” which does not even exist until a refresh() has been processed (or actually recalc()). And if called between abeginUpdate()//endUpdate() pair, this is not done synchronously.

For example, at first glance, this code might seem to be good:

view.beginUpdate();
view.addItem(theItem);
var firstItem = view.getItem(0);

But as you all know, the getItem() will fail. (assuming an empty view)

Suggest to rename getItem() to getRow().

I realize this rename could also mean that other (public) methods should be renamed, ones that operate on the same data set (i.e. the rows member variable)`.

I know this is a breaking change. Deprecation is of course advised. At first merely in the documentation and later even a console.warn() could be added to the old method.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
6paccommented, Jun 3, 2017

While deprecation is an option, it’s still disruptive in the end. What I tend to prefer is to release a new breaking version and then have an additional package to make it backwards compatible by overriding new features or mapping the old names to the new, like how jQuery-migrate worked in the old days. That said, it’s hard to gauge how popular Slickgrid is, and therefore what impact breaking changes would have.

I have a private branch which may be able to feed back significant changes and improvements, but it’s too early to tell yet how many resources I’m going to be able to devote to that - it’s part of another project.

0reactions
neonrustcommented, Jun 5, 2017

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Get Particular Column Value From Datatable In Uipath
In case a developer wants to rename these columns to namely: ID, ... After that, we can do the CopyToDataTable () function so...
Read more >
Get Row Item - UiPath Documentation Portal
HomeUiPath Activities GuideRecipesAPI ReferenceReferenceChangelogDiscussionsPage Not FoundSearch{{ state.current().meta.title }}API Logs.
Read more >
Class: DataView - GrapeCity
node, Element. An HTML element which is used to host the DataView instance. ... getCachedBatchActions() ... getRowInfoFromId(rowId){object}.
Read more >
get data of selected rows in slickgrid - Stack Overflow
getData().getItem(value) relates to the type used for storage in the grid: the former works for arrays, the latter for Slick.DataView.
Read more >
Dataviews - Oracle Help Center
Dataviews · From the Edit grouping label, click Dataviews. · In Dataview, click rename dataview icon , enter a name in the New...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found