Giter VIP home page Giter VIP logo

Comments (10)

tejcirkulate avatar tejcirkulate commented on May 12, 2024 1

Hi Paul,

I am trying to do something similar for subset of the entire table.

Lets say a table consists of (10 rows, 10 cols).

An Ajax call fetches new data for cells starting from (row 3, col 2) to (row 6, col 7).

I would like to be able to call setData as show in this example:
http://jsfiddle.net/ruvu0895/

But,specify that the data is set of cells starting from (row 3, col 2) like:

$('#my').jexcel('setData', data, 3, 2);

Is there a way to accomplish this please?

from ce.

pphod avatar pphod commented on May 12, 2024 1

The method insertRow can give you the option to add new row with default data. If this is not what you are looking for, you can change your data variable and call setData again without any argument, this going to refresh the data.

from ce.

felixvandal avatar felixvandal commented on May 12, 2024

i have begin to look around some method that i have not tried already
i found that if i add data programmatically, the data are removed from the row that move up
i found that setValue is working well, but i have to assign data one by one
i was wondering if there was a better way since my table have 12 columns

from ce.

pphod avatar pphod commented on May 12, 2024

The correct method is setData. Here is one example of updating the entire table data and one loading remote data via a CSV file.

http://jsfiddle.net/rzr3gL8c/
http://jsfiddle.net/ruvu0895/

from ce.

pphod avatar pphod commented on May 12, 2024

I have checked and the website seems to be OK. Could you let me know which link you are trying to access?

from ce.

pphod avatar pphod commented on May 12, 2024

the setData should be use to reload some data into an existing jExcel table.

from ce.

felixvandal avatar felixvandal commented on May 12, 2024

i keep on getting the Cannot set property 'data' of undefined
same spot in the jquery.jexcel.js
i have fellowed the fiddle and i keep getting the error
here is how i proceed, maybe i missed something and you will be able to point it out

i use the onchange event of the jexcel creation on a div
in the function referenced by the onchange event i have an ajax that go pump data from my database
on success, i call a function to import those data to a multidimension array
after that, in the same function, i call $("#datagridContent").jexcel("setData", arrayItem);
for some reason i keep getting the same error

i even created an array with only simple string and keep getting that error
i continue to dig on my side

thank you again for your time

from ce.

felixvandal avatar felixvandal commented on May 12, 2024

i found some reasons to some of my troubles
when you want to setData from the onchange, you must use the object pass in parameter (lesson learn)
second, my trouble is apparent when you copy paste data in the cell
when you copy paste the object pass is the cell, when you manually write data, the object pass is the table
whatever the way you are doing it, the moment you copy paste, the onchange event fire and the cell is pass instead of the table
i will take a look in the script to try to found the problem, i will keep you posted

Edit:
found the problem (if its a problem)
the paste function pass the cell to setValue
the setValue call onchange($(this), $(v), value), so basically the onchange receive 2 reference to the cell and the value of the cell
would it be a good idea to always pass object, cell, value instead of caller, cell value?

from ce.

pphod avatar pphod commented on May 12, 2024

from ce.

felixvandal avatar felixvandal commented on May 12, 2024

i have fixed my problem by getting the object by my own method instead on relaying on the jexcel to pass me the right object

from ce.

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.