writelesscode

On Rails, Ext JS, Netzke, and nomadic lifestyle

One-to-Many Associations in Netzke
June 27, 2010

One-to-many associations in NetzkeLet's say we have a grid listing clerks, and we want to be able to assign a boss to a clerk (yes, my "favorite setup":http://demo.netzke.org/grid_panel). A traditional way to do this is by using a combobox listing available bosses as options. Netzke does it for you automatically when it detects a foreign key between the model's attributes. However, sometimes we want to be in more control over how one-to-many associations are handled in Netzke grids and panels. This tutorial will show you how to configure the following: * How each boss should be represented in the drop-down list. Will it be her first name or last name? Or maybe an arbitrary string that combines them both and eventually includes some extra info (such as the boss' salary)? * Scoping out bosses in the drop-down list. We may not want to list all the bosses in the drop-down list. How could we limit those to a specific department, for instance?

The rest of the tutorial is hosted on the Netzke wiki on GitHub. Please, help me keep it up-to-date by editing the wiki.

"Continue reading the tutorial":https://github.com/netzke/netzke/wiki/One-to-many-associations.

comments powered by Disqus

Max Gorin

Web developer and digital roamer since 2008. Author of Netzke. Feminist, atheist, life hacker, and common sense devotee.

Twitter | GitHub | LinkedIn

Tags

  1. tutorials (14)
  2. netzke (26)
  3. rails (1)
  4. 0-7 (3)
  5. testing (2)
  6. videos (1)
  7. speaking (5)
  8. 0-8 (5)
  9. productivity (1)
  10. frontend (1)
  11. web-development (1)

By Year

  1. 2016 (1)
  2. 2015 (3)
  3. 2014 (2)
  4. 2013 (4)
  5. 2012 (5)
  6. 2011 (3)
  7. 2010 (6)
  8. 2009 (4)
  9. 2008 (1)