Skip to content

Instantly share code, notes, and snippets.

@gu-fan
Created June 26, 2014 11:46
Show Gist options
  • Save gu-fan/8f3618186ad6575829b8 to your computer and use it in GitHub Desktop.
Save gu-fan/8f3618186ad6575829b8 to your computer and use it in GitHub Desktop.
$dynamic_table.handsontable
startRows: 15
startCols: items_len
minSpareRows: 1
colHeaders: $.cs_data.cs_items_name
data: load_item()
columns: item_col_settings
afterChange: (changes, source)->
if changes != null
row = changes[0][0]
col = changes[0][1]
if col == category_col
category = item_table.getDataAtCell(row, category_col)
products = load_product(category)
item_col_settings[items_id.product_name] =
type: 'dropdown'
source: products
item_table.updateSettings({columns:item_col_settings})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment