GithubHelp home page GithubHelp logo

Paste source about ce HOT 24 CLOSED

jspreadsheet avatar jspreadsheet commented on May 17, 2024
Paste source

from ce.

Comments (24)

pphod avatar pphod commented on May 17, 2024 1

from ce.

pphod avatar pphod commented on May 17, 2024

If you copy from excel and paste on notepad for example, you will see you will have a new line on notepad. This is a natural behavior form excel that includes a new line on your clipboard on copying cells. And, because of that, we have a new line on jExcel.

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

aaaa ok!
so if i want a new line after i paste data i should add it myself, got it.
i thought it was a behavior of jExcel

from ce.

pphod avatar pphod commented on May 17, 2024

Hi Felix, there is an option might be useful. Update from the branch 1.3.0

There is a feature called minSpareRows, after the paste you can always have X blank rows.

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

i will check it out
eventually, will there be a way to undo and redo copy paste?
thank you for your time

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

the branch is not stable for my code
first of all the table keep adding row because of the onchange i think
second, i use jExcel to populate a table of tarification and the table is not fully loaded
i will keep using the master

from ce.

pphod avatar pphod commented on May 17, 2024

The copy/paste undo on copy and paste is fully working on my tests. About the compatibility can you share you example on fiddle. The branch should be merged soon with the master after full tests. I have not found any exception yet and should be fully compatible. About adding a new row, you can block that by defining not allowed to add new row. Can you share you example and point any problems?

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

hard for me to tell you what is wrong when so many things happen at the same time
the page keep refreashing and i dont have any control on what is going on
i will run some test and come back to you
all i know is when i disable the onchange event everything is ok (only test i did so far)

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

for some reason a onchange event is raised for each cell (even when reloading the page, so no data)
my onchange do an ajax call to fetch some data in my database when one of the column is unselected
the ajax then go and getData from the table.
i create an array with the data retrieve from the database.
i splice the array in the array produce from the getData function.
Finally, i setData with the array create from getData
on a final note, i add the class readonly to all item containing the class c10 since its a total column for the row
its basically what my onchange do. i will try playing with it to find if i can do this in a better way
i hope i gave you enough details

from ce.

pphod avatar pphod commented on May 17, 2024

I have a new update might be more compatible with you have done.
http://jsfiddle.net/paulhodel/0dyms2b9/

from ce.

pphod avatar pphod commented on May 17, 2024

It is published as 1.3.0

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

I will test it and let you know how it went

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

it kinda work
let me rephrase
with minSpareRows:1, when the paste is from another source than excel, a line is added
still with the same min spare rows, when i paste from an excel source there is 2 lines added
jExcel add the data of the paste row, than do a onchange event on the first line added that result in a third line added
i would like to give freedom of choice to the users to where they are going to get the data
the same result happen when i copy more than one row from an excel

also, i was reaffecting the value of a currency cell onchange
since i get the new code, i get a Reach max query when i use the fellowing code

$('#wrapperDataGridContent').jexcel("setValue", "9-" + row, unitCost.toFixed(2) + "$", true);

i checked and this trigger a very huge amount of onchange event, like over 500
i did that because i do not like the way jQuery Mask Plugin work (for so many reasons)
do you have an alternative for a currency mask?

thank you again for your time

from ce.

pphod avatar pphod commented on May 17, 2024

The problem is: the setValue trigger a change event in the new version as should be. If you call a setValue inside a onchange handler you will trigger a loop.

You have 3 alternatives:

  1. integrate another mask component using this example:
    http://www.bossanova.uk/jexcel/integrating-a-third-party-plugin-into-your-spreadsheet

  2. Call another method to change the value of your cell. This will keep history for undo/redo.
    $(main).jexcel('updateCell', { cell:yourcell, newValue:'asdf', oldValue:'asdf' });

  3. Considering it is a text column, you can manually change the data by:
    $.fn.jexcel.defaults[id].data[y][x] = yourvalue;
    $('yourtable').find('#'+x+'-'+y).html(yournewvalue);

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

i will check this first thing in the morning tomorrow
as always, thank you for your time

from ce.

ashraftalib avatar ashraftalib commented on May 17, 2024

@paulhodel Issue is while pasting from MS excel or Google spreadsheet cell data to jexcel cell.
Data have some break lines in data-content. In Jexcel while pasting it is making extra new column for every breakline and is putting data into new columns with breaked data. But it should have to be in one single cell same as in Google Sheet or MS. I am attaching two screenshots :
1-one is source from Google Spreadsheet or MS Excel.
2-other one is after pasting into jexcel cell.
1
2

Please help me thank you very much.

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

Hello again Paul
the fix offer for the mask work very well
looking down jexcel.js i found that i could force a value with the updateCell to pass over cell with readonly property
if i can suggest something, the documentation could use a polish
you can't assume everyone will be digging in the js to find that jexcel can offer

from ce.

pphod avatar pphod commented on May 17, 2024

from ce.

pphod avatar pphod commented on May 17, 2024

from ce.

felixvandal avatar felixvandal commented on May 17, 2024

a ok! i did not saw that feature before. thats why i was asking

from ce.

PragnaBrahmbhatt avatar PragnaBrahmbhatt commented on May 17, 2024

@paulhodel Thanks for your instant support.
I need to display excel like UI. So this plugin is excellent but want to display so many fields like in excel. And inside that dynamic data will be loaded.
Please check the screenshot.
excel

from ce.

pphod avatar pphod commented on May 17, 2024

from ce.

PragnaBrahmbhatt avatar PragnaBrahmbhatt commented on May 17, 2024

Thank You. Its working.
Is there any function for table horizontal overflow.
tableHeight:'450px',
tableOverflow:true,
By using this overflow-y will be scroll but for horizontal scroll Is there any function??

from ce.

PragnaBrahmbhatt avatar PragnaBrahmbhatt commented on May 17, 2024

@paulhodel
I added below line in jquery.jexcel.js at line number 1370 and now horizontal scroll works fine.
$(tbody).parent().parent().css('overflow-x', 'scroll');

I added this here so it can help other.
Thank you

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.