Comments (7)
You'll have to give me an example of what you're trying to do.
from tkintertable.
Here I am trying to read a file from the user which can only be a spreadsheet. When I am trying to edit the cells they just revert back to their original state. I need to them to be in the changed state and can you also suggest me how to reflect the same changes in the file from which the values are being displayed.
from tkintertable import TableCanvas, TableModel
from tkintertable import *
from tkinter import *
from xl2dict import *
filepath = ''
def openFile(event=None):
global filepath
filepath = filedialog.askopenfilename(filetypes=[('Excel files','.xlsx'),('Excel 2009 files','.xlx'),('CSV files','*.csv')])
displayTables(filepath)
def displayTables(filepath):
master = Tk()
master.geometry("1024x720")
master.title('Spreadsheet UI')
obj = XlToDict()
a2d = obj.convert_sheet_to_dict(file_path=filepath)
data = {}
for i in range(0,len(a2d)):
data.update({str(i):a2d[i]})
tframe = Frame(master)
tframe.pack(fill=BOTH,expand=1)
table = TableCanvas(tframe,data=data)
model = table.model
model.importDict(data)
#table.redraw()
table.show()
master.mainloop()
open_win = Tk()
open_win.geometry("200x100")
open_win.title("Spreadsheet UI")
btn = Button(open_win,text="Import file",command = openFile)
btn.pack()
from tkintertable.
You must not be updating the dict the way you need to. It doesn't look to me like you're doing anything to change it. setting data.update({str(i):a2d[i]})
just copies the other dict?
from tkintertable.
I have not done anything to update the dictionary. I can not understand how to retrieve the updated values from the cells. If I can understand that then I will something about updating the values. I need help with retrieving the values from the cells.
from tkintertable.
You should be able to retrieve the cell values this way:
data = table.model.data
cols = table.model.columnNames #get the current columns
value = data[row][col]
from tkintertable.
How would I know which row or col is updated by the user? That's the problem.
from tkintertable.
Maybe you could sub-class the table and override the drawCellEntry method and run the code you need inside that method.
from tkintertable.
Related Issues (20)
- GPL or copyright? HOT 1
- How to autoResizeColumns correctly HOT 2
- Solved: Is it possible to make readonly just a single column ?
- rowspan and colspan HOT 1
- Values on table overlapping (Visual overlapping) HOT 1
- Draw Text does not work. HOT 1
- importCSV doesnt work HOT 2
- sys is not defined HOT 6
- isLink function in Tables.py logic issue HOT 2
- No Way to add several columns at ones HOT 1
- Left clicking bug
- Bug in `TableModel.deleteColumns()`
- Omit filter term in model.getColumnData
- Freezepane HOT 1
- Question on Data type HOT 1
- No Option to Insert Images Into TkinterTable? HOT 2
- Usage doc problem
- ListType outdated
- Output: "Did not find preferences!!!" HOT 1
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 tkintertable.