20130424 (Wednesday, 24 April 2013)

Virtual remote fields in an ExtJS grid

Solved a subtle last problem which had managed to slip through the tests: virtual remote fields in an ExtJS grid were rendered without value because StoreField.as_js gave them the name of the delegated field.

The new column “Coaches” in welfare.courses.PendingCourseRequests was empty in the extJS version.

More accurate column widths

The age slice columns of welfare.courses.PendingCourseRequests were rendered in ExtJS always a l ittle bit to narrowly so that one had to adjust their width in order to see their header.

In linoweb.js Lino defines the following JavaScript function:

Lino.chars2width = function(cols) {  return cols * 9; }

And Lino generated the following JS code for each columns:

new Lino.NullNumberColumn({ "colIndex": 11, "sortable": false,
"format": "0", "editable": false,
"tooltip": "(courses.PendingCourseRequests.a16) ",
"header": "16-24", "dataIndex": "a16",
"width": Lino.chars2width(5) }

So ExtJS gave that column a with of 5 * 9 = 45 pixels.

The width of the rendered JS code comes from lino.ui.elems:

kw.update(width=js_code("Lino.chars2width(%d)" % (w)))

I replaced this by:

kw.update(width=js_code("Lino.chars2width(%d)" % (w+1)))

IOW I add 1 character (9 pixels) to the theoretic column width.

Preparing for the next release

The next release will be only for Lino Welfare, not for atelier, site and north because there were no important changes in those projects.

Lino 1.6.6 Lino-Welfare 1.1.3

Updated the LETS tutorial

For Michaël: A Local Exchange Trade System

A parameter panel for PendingCourseRequests

In der welfare.courses.PendingCourseRequests muss ich noch ein params_panel machen, damit man bequem filtern kann.

Hier hat Lino mich nochmal wieder überrascht: es war kinderleicht, die Filterparameter von pcsw.Clients zu “erben” und in den eigenen Filter zu übernehmen.

More workflow management for course requests

Added a workflow_buttons column to welfare.courses.PendingCourseRequests and two workflow actions: from inactive to active and retour. Also added a CourseRequest.get_row_permission to hide the “Register” action in this table (because it would always say “cannot register to unknown course”).

TODO:

  • warum kann man ein CourseRequest nicht auf aktiv zurücksetzen?
  • Problem userdocs: welfare.courses.PendingCourseRequests funktioniert nicht.