Comments (7)
こんにちは @fujita1106.
「イベントで取得した値」とはなんでしょうか?可能であればサンプルコードを提供していただけますか?
Hi @fujita1106.
What does "イベントで取得した値"(value obtained at the event) mean? Would you please provide sample code?
from cheetah-grid.
listenを使用してセルクリック時に値を取得・代入しています。
値の内容を基にセルの色を変えたいです。
grid.listen(CLICK_CELL, (...args) => listener(args));
const listener = (args) => {
const records = grid.records;
if(records[row]["field"] == "")
{
records[row]["field"] = "value";
//row,fieldで指定したセルの背景色を変更したい。
}
};
thanks
from cheetah-grid.
Thank you for provide a sample code.
You can change the style (color etc.) for each record by specifying a function in the style
property of the column definition.
I think you can check for changes in the fields of record and use it to change the color for each cell.
カラム定義のstyle
プロパティに関数を指定する事でレコードごとにスタイル(色など)を変更することができます。
レコードのフィールドの変更をチェックし、style
プロパティに関数を指定する事でセルごとに色を変えることができると思います。
from cheetah-grid.
Thank you for your response.
以下コードで試してみたのですが列の背景色が変わりません
grid.layout.body[0][col].style = {
textAlign:"center",
bgColor: "green"
};
grid.invalidate();
styleプロパティ上は背景色が定義されていそうなのですが...
Sorry to ask such a elementary question.
from cheetah-grid.
You use the function.
from cheetah-grid.
Oh it's not. You need to specify it when defining the column. It cannot be rewritten later using the property.
from cheetah-grid.
I got it!
Thanks to you I was able to understand that.
from cheetah-grid.
Related Issues (20)
- Can't edit a column when `field` is defined as a function HOT 1
- Feature Request: Tool Tip HOT 1
- Website is broken HOT 2
- Is the react version not support multiple headers?
- Change the position of the sort icon
- How can I prevent header and row number from being focused? HOT 1
- How define a customer action like autocomplete input (like typehead or vue-simple-suggest)
- Cannot find module 'react-cheetah-grid' in Jest test HOT 4
- Fill Cell by message type HOT 2
- Cell selection behaves strangely in iOS 16 HOT 2
- Support for double and squiggly lines using themes
- Support for triangular mark in the upper right corner like Excel's comments
- Support the thickness of the border.
- Open InlineMenuEditor dropdown with double-click instead
- Working with a single cell HOT 4
- Compatibility for Vue3/Nuxt3 HOT 2
- vue-cheetah-gridのaction propsにつきまして HOT 4
- How can I have each row perform different merge cell logic? HOT 3
- 'Button/Icon' filter in column header HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cheetah-grid.