Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select Editなど一覧表表示コンポーネントの完成 #30

Open
fumi-m opened this issue Nov 5, 2018 · 0 comments
Open

Select Editなど一覧表表示コンポーネントの完成 #30

fumi-m opened this issue Nov 5, 2018 · 0 comments
Assignees

Comments

@fumi-m
Copy link
Owner

fumi-m commented Nov 5, 2018

完了条件

  • enum型のrawデータ、日本語化データの表示
  • lookup型のrawデータ、サマリーデータ(selectbox)、関連するデータを編集不可カラムとしての表示
  • on/off型データに対する Slick.Chckeckboxの適用

Select2の導入

memo

var select_opt[i] = data[i]
dataSource:select_opt[i]

populateSelect : そのまま
Select2Editorもそのまま

data[i] = Hash of key:value

dataViewを実装する

// Create the DataView.
var dataView = new Slick.Data.DataView();

//Create columns
var columns = [
  {id: "column1", name: "ID", field: "id"},
  {id: "column2", name: "Language", field: "lang"},
  {id: "column3", name: "Year", field: "year"}
];

// Pass it as a data provider to SlickGrid.
var grid = new Slick.Grid(containerEl, dataView, columns, options);

// Make the grid respond to DataView change events.
dataView.onRowCountChanged.subscribe(function (e, args) {
  grid.updateRowCount();
  grid.render();
});

dataView.onRowsChanged.subscribe(function (e, args) {
  grid.invalidateRows(args.rows);
  grid.render();
});

var data = [
  {'id': 'l1', 'lang': 'Java', 'year': 1995},
  {'id': 'l2', 'lang': 'JavaScript', 'year': 1995},
  {'id': 'l3', 'lang': 'C#', 'year': 2000},
  {'id': 'l4', 'lang': 'Python', 'year': 1991}];

// This will fire the change events and update the grid.
dataView.setItems(data);

@fumi-m fumi-m self-assigned this Nov 5, 2018
@fumi-m fumi-m changed the title Select EditとDB更新部の自作 Select Editなど一覧表表示コンポーネントの完成 Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant