Re: [qooxdoo-devel] Some beginner questions regarding remote tables - scrolling, loading and select
Brought to you by:
ecker,
martinwittemann
From: Michael H. <ma...@mi...> - 2009-05-01 14:03:03
|
Hi Derell, thanks for your patience! I finally found the reason for the strange behavior of my table: I messed up the PHP Code. Instead of returning the row count I was also feeding the qooxdoo application with a JSON Data string - so the table model did not get the information of how many rows to display. Maybe this is a suggestion for adding another line in the RemoteTable tutorial. In the Backend-Section it writes "The backend has to deliver the requested data in a JSON data structure in order to display the data correctly." This is, of course, correct, but it would be nice if one was getting some information that the backend has also to deliver the amount of rows that is going to be displayed in the table. This is what _loadRowCount needs (and what "http://localhost/services/getTableCount.php" is supposed to deliver). Maybe one could be a little bit more explicit, it could help beginners like me. Anyway, think I have learned much about qooxdoo while struggling with this prblem. I'm appreciating this framework more and more. Thanks! Michael Derrell Lipman schrieb: > On Thu, Apr 30, 2009 at 7:18 PM, Michael Helwig <ma...@mi... > <mailto:ma...@mi...>> wrote: > > Hi, > I'm still struggling with the table. I changed the selection mode to 2 > (since I noticed that 1 means "no selection"), however, this does NOT > influence the table's behavior. I figured out that I can add a > selection of some cell via code and then, once a cell is selected, I > can navigate through the table with the help of the arrow-keys. I even > can set columns editable and edit cells when double-clicking on them, > once they are selected. However, a single click does NOT select a row > or a cell (I tried to write an event listener for the table reacting > on a cell-click event, but somehow the event is not send when I click > on a cell). Nor do I have sucess with scrolling. The data is loaded > correctly, but it is cut of by the table and I do not know how to > show it. > > I'm wondering what's going on with this widget. I read through the > tutorials and examples once again but there seems to be no relevant > difference. Any help would be greatly appreciated. > > > Hi Michael, > > Try this code in the playground app. When you run this, you can click on > a row in the table and you'll see an alert come up showing the ranges of > selected rows. Use ctrl-click to add a selection, or shift-click to > select the range between the previous selection and the current click, > or control-shift-click to keep any out-of-order existing selections and > add a new range of selected rows beginning at the previous selection and > extending to the current click. > > var tableModel = new qx.ui.table.model.Simple(); > tableModel.setColumns(["one", "two", "three"]); > var table = new qx.ui.table.Table(tableModel); > this.getRoot().add(table); > var tableData = [ ["row 1", "a", "A"], > ["row 2", "b", "B"], > ["row 3", "c", "C"], > ["row 4", "d", "D"] > ]; > tableModel.setData( tableData ); > var selectionModel = table.getSelectionModel(); > selectionModel.setSelectionMode(qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION); > selectionModel.addListener("changeSelection", > function() > { > var msg = > qx.dev.Debug.debugObjectToString(selectionModel.getSelectedRanges(), > > "selected ranges"); > alert(msg); > }); > > > Hope this helps. > > Derrell > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > > > ------------------------------------------------------------------------ > > _______________________________________________ > qooxdoo-devel mailing list > qoo...@li... > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |