ianharrigan / haxeui

IMPORTANT NOTE! This repository is no longer maintained. Please consider the newer version: https://github.com/haxeui/haxeui-core
http://haxeui.org/
392 stars 47 forks source link

TableView usage #369

Open upperxcode opened 6 years ago

upperxcode commented 6 years ago

Hello, I have tried using the ui TableView component, but I have not yet had much success. The way I'd like to use it is by making the definition in xml and capturing the obecjt for then populate.

 <tableview  id="tabela" style="width:100%;height:100%;padding:0;">
       <header style="height: auto;width:100%;">
             <column id="title" text="Título" style="width:15%" sortable="true" />
              <column id="author" text="Autor" style="width:35%" sortable="true" />
              <column id="alive" text="Ativo" style="width:50%" sortable="true" />
        </header>
</tableview>

Everything has gone well, the only problem is that my data does not appear. I wish to later populate with the result of a sql query, but at the precise moment just the data appear, they are in the TableView, but the cells are unformatted and the fonts do not appear.

     var data:TableView = mainView.findComponent("tabela",null,true);
      data.dataSource.add({title : "La Horde du contrevent", author : "Alain Damasio", alive : true});
      data.dataSource.add({title : "La fraternité du Panca", author : "Pierre Bordage", alive : true});
      data.dataSource.add({title : "Ravage", author : "René Barjavel", alive : false});
ianharrigan commented 6 years ago

Hi,

Which backend are you using? Its also worth keeping in mind the tableview is experimental and will be vastly different in the future. That said, it should work (albeit not particularly performant)

Cheers, Ian

ianharrigan commented 6 years ago

Ok, that should be fixed now. I added a quick hack to make it work. As i mentioned, TableView is experimental and will totally rewritten in a different branch at some point in the near future.

Let me know if that works.

Cheers, Ian

ianharrigan commented 6 years ago

oh, hang on. This HaxeUI version one repo... did you mean to post this issue there? HaxeUI v1 is no longer maintained.

upperxcode commented 6 years ago

hello thank you for the answer I'm starting in Haxe, I read a little and I liked it a lot. I'm currently using QT in production, but Haxe's philosophy interests me. It's a bit confusing for anyone coming from a framework, rs. I'm using NME and I'm still not sure how it works, I've been thinking about doing a little form for registration and a tableview to show the data.

upperxcode commented 6 years ago

wonderful! Yes it's working now. Tell me where can I find information on the progress of Haxeui? I wish to make application for desktop and web.

Thank you!

upperxcode commented 6 years ago

Testing a little more. The data is shown as expected when I compile using: haxelib run nme test Project.nmml However when I run the file already compiled in the OS it brings the empty cells, I have no idea why. I'm using linux for this.

upperxcode commented 6 years ago

Answer me where can I download the version 2 fonts? I've read some postings of yours and I've seen that it encourages you to do the implementations using XML, so if I follow this direction will it be easier to migrate to version 2?

Their work is very good and was exactly what I was looking for, UI components with possibly CSS styles. Congratulations on the excellent work.

ianharrigan commented 6 years ago

Version 2 is here: https://github.com/haxeui/haxeui-core

If you are starting a new project then it doesnt really matter if its xml or code. I generally use xml anyway as i think its cleaner, but many dont think so / agree. So really its your preference.

The API from V1 -> V2 isnt really that different. The internals have changed ALOT but the outward API isnt too different at all, so migration woes should be minimal.

upperxcode commented 6 years ago

first of all thanks for the quick reply.

Just one more question that I would like to take with you: I intend to build a stock control application in the MVC standard, researching I found that the NME would be the most appropriate as a backend. Do I think I'm on the right track or would I have any other suggestions? I really felt a little lost with Haxe's philosophy in regard to this.

ianharrigan commented 6 years ago

If you are using HaxeUI2 and arent using anything specific to the framework (eg: NME draw API) then it shouldnt matter, you can switch "backends" really easily with HaxeUI2 and get it output applications using a variety of different backends (a backend is a framework specific lib that works with HaxeUI2 basically).

Failing that, probably yeah, NME or OpenFL might be your best options. Its hard to say ofc without knowing what you actually want the app to do, and which platforms, etc.