myliang / x-spreadsheet

The project has been migrated to @wolf-table/table https://github.com/wolf-table/table
https://myliang.github.io/x-spreadsheet
MIT License
13.97k stars 1.67k forks source link

Here some recommendations to make it better and essentials #668

Open onigetoc opened 9 months ago

onigetoc commented 9 months ago

1 - Adding row on right with insert a new row before insert a new row after BTW, you cannot add a row after the last row 2 - Adding row want you hit Enter when you are on the last row. if you use Enter often it should do a row everytime. 3 - Allowing a search bar to filter element with the entire row. 4 - Double click on top row A, B,C ect to toggle row order. 5 - Clicking on the first cell, the top left select all. 6 - Using multiple cells selection for mobile and tablet like Microsoft Excel. 7 - Allowing loading json file. ( I got some partial success trying to implement it, see bellow ) 8 - Adding a Calendar for date.

image

I got some partial success trying to load .json files

`function transformJson(json) { let data = []; let rows = [];

if (!json || json.length === 0) { return data; }

let headers = [];

if (json[0]) { headers = Object.keys(json[0]); } else { console.error('Le tableau JSON est vide ou ne contient pas d\'éléments.'); return data; }

let headerRow = { cells: {} };

headers.forEach((header, index) => { headerRow.cells[index] = { text: header }; });

rows.push(headerRow);

json.forEach((row) => { let rowData = { cells: {} };

headers.forEach((header, index) => {
  rowData.cells[index] = {
    text: row[header]
  };
});

rows.push(rowData);

});

data.push({ name: "Sheet1", rows: rows, merges: [] });

return data; } `