Note that there are some explanatory texts on larger screens.

plurals
  1. PODatagrid events not working inside a titlepane
    primarykey
    data
    text
    <p>I am new to Dojo and trying to create Datagrid that can be expanded on click. So, I have decided to put the datagrid inside a titlepane, so that the datagrid can be shown on expanding titlepane.</p> <p>titlepane works great, i can set the data grid inside. Everything fine so far. The only problem is, I couldn't get the click events inside the datagrid. ( i couldnt do row selection, sort, etc.)</p> <p>I am using dojo 1.8.3 and here is my code</p> <p>function(taskListModel){ var tasks = taskListModel.getData();</p> <pre><code>require(["dojo/ready", "dijit/TitlePane", "dojo/dom"], function(ready, TitlePane, dom){ ready(function(){ taskListTitlePane = new dijit.TitlePane({title:"Click here to see Task List", content: "Collapse me!"}); dom.byId("taskListTitlePane").appendChild(taskListTitlePane.domNode); createTaskDataGrid(tasks); }); });} </code></pre> <p>grid creation:</p> <pre><code>var createTaskDataGrid = function(tasks){ </code></pre> <p>/<em>set up data store</em>/ var data = { identifier: "id", items: [] };</p> <pre><code>// push the data into items for(var i = 0; i &lt; tasks.length; i++){ data.items.push(lang.mixin({ id: i+1 }, tasks[i])); } var store = new ItemFileWriteStore({data: data}); /*set up layout*/ var layout = [[ {'name': 'S.No', 'field': 'id', 'width': '10%'}, {'name': 'TaskName', 'field': 'task_name', 'width': '20%'}, {'name': 'Assignee', 'field': 'assignee', 'width': '20%'}, {'name': 'Module', 'field': 'module_name', 'width': '20%'}, {'name': 'DueDate', 'field': 'taskid', 'width': '15%'}, {'name': 'Status', 'field': 'status', 'width': '15%'} ]]; /*create a new grid*/ var grid = new DataGrid({ id: 'grid', store: store, structure: layout, rowSelector: '20px', autoHeight: true}); /*append the new grid to the div*/ grid.placeAt("tasklistscroller"); /*Call startup() to render the grid*/ grid.startup(); grid.on("RowClick", function(evt){ var idx = evt.rowIndex, rowData = grid.getItem(idx); //console.log("row data is = " + rowData.task_name + " " + rowData.taskid); mainController.taskSelected(rowData.taskid, rowData.task_name); }, true); if(taskListTitlePane !== null){ console.log("setting grid inside title pane"); taskListTitlePane.setContent(grid.domNode); //taskListTitlePane.containerNode.appendChild(grid.domNode); }} </code></pre> <p>Any help would be great.</p> <p>Thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload