Code Monkey home page Code Monkey logo

Comments (6)

Holt59 avatar Holt59 commented on July 19, 2024

id is the index of the row in the unfiltered dataset, so you could simply use it. Or am I misunderstanding what you want?

from datatable.

AndreCabrera avatar AndreCabrera commented on July 19, 2024

I want to do this:

xsxs

Enumerate all rows automatically, including when filter, add and delete data, is it possible?

from datatable.

Holt59 avatar Holt59 commented on July 19, 2024

What do you want to see when you have filtered data? Something like this?

#|    Field1    Field2
1|
3|
4|
6|

If so, you can simply use the id (maybe id + 1).

from datatable.

AndreCabrera avatar AndreCabrera commented on July 19, 2024

nop, let's suppose to I have 6 rows in my datatable in first time, so when I filtered data (for example this filter get me only 3 rows) I want to see :
**
#| Field1 Field2
1|
2|
3|
**
I don't want this:
**
#| Field1 Field2
1|
4|
6|
**
Another example: if I have 6 rows in first time and I delete the row 5, I want:
**
#| Field1 Field2
1|
2|
3|
4|
5|
**
I don't want:
**
#| Field1 Field2
1|
2|
3|
4|
6|
**

from datatable.

Holt59 avatar Holt59 commented on July 19, 2024

There is no built-in way, but the row are appended to the tbody element sequentially, so you could simply count the number of tr in the tbody, e.g. (not tested):

lineFormat: function (id, data) {
    var pageRowNum = $(this).find('tbody tr').length;
    var rowNum = (this.getCurrentPage() - 1) * this.options.pageSize + pageRowNum + 1;
    // Whatever you want...
}

from datatable.

AndreCabrera avatar AndreCabrera commented on July 19, 2024

it works !!, thanks so much.

from datatable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.