Coder Social home page Coder Social logo

Comments (5)

gudipudipradeep avatar gudipudipradeep commented on August 24, 2024

Please can you share the article on rows and column updates example.

from fortune-sheet.

shuanhukexuejia avatar shuanhukexuejia commented on August 24, 2024

https://ruilisi.github.io/fortune-sheet-docs/guide/api.html#overview, API is avaible via the ref of Workbook

from fortune-sheet.

gudipudipradeep avatar gudipudipradeep commented on August 24, 2024

App.js
import React, { useRef, useState, useEffect, useCallback } from "react";
import ReactDOM from 'react-dom';
import "./styles.css";
import { Workbook } from "@fortune-sheet/react";
import "@fortune-sheet/react/dist/index.css"
import { produce } from "immer";
import { ComponentMeta, ComponentStory } from "@storybook/react";
import { Sheet } from "@fortune-sheet/core";

export default {
component: Workbook,
} as ComponentMeta;

const settings = [
{
name: "Terminal",
id: 0,
status: 1,
defaultRowHeight: 20,
scrollLeft: 0,
column: 25,
row: 20,
config: {rowlen: {"0": 50}},
celldata: [ {"r": 0,"c": 0,"v": {ct: {fa: "General", t: "g"},m:"Nameofthescript",v:"Name of the script","bg": "#858a7e","ht":"0"},},
{"r": 0,"c": 1,"v": {ct: {fa: "General", t: "g"},m:"BuyRate",v:"Buy Rate","bg": "#00ff00","ht":"0"},},
{"r": 0,"c": 2,"v": {ct: {fa: "General", t: "g"},m:"Quantity",v:"Quantity","bg": "#00ff00","ht":"0"},}
]
}
];

const App = () => {
const [sheets, setSheets] = useState(settings);
const onChange = useCallback((d: Sheet[]) => {
d[0]["data"][0][1] = {ct: {fa: "General", t: "g"},m:"Values",v:"Buy","bg": "#00ff00","ht":"0"};
setSheets(d);
}, []);
return ;
};
export default App;`

above code failing with semi colon issue with below line of code.
export default {
component: Workbook,
} as ComponentMeta;

Please can you guide what went wrong with

from fortune-sheet.

shuanhukexuejia avatar shuanhukexuejia commented on August 24, 2024

Maybe you should delete ',' at
image.
In addition, this error is not related to this project.

from fortune-sheet.

gudipudipradeep avatar gudipudipradeep commented on August 24, 2024

Thanks, please can you provide js example. We have only typescript examples. It will be helpful @shuanhukexuejia
Please add multiple example in react js like

  1. Update cell continually by math.random()
  2. Update sheet by consolidating multiple sheet.
  3. Onchange and readonly cell dynamically
  4. Adding UI components like chart, button.
  5. Onchange vs auto update cell by math.random()
  6. Like view example we couldn't found much over internet and it will helpful for starting

I started on this library recently I will post few example for reference once am good with library.
If

from fortune-sheet.

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.