Permalink
Browse files

Consistently remove the row, so it works with a single row

  • Loading branch information...
1 parent 1efc91f commit 7d5db84b422cfa04b5d0d07c5ecf3d90905aa7a0 @kriszyp committed Sep 18, 2012
Showing with 39 additions and 1 deletion.
  1. +1 −1 List.js
  2. +38 −0 test/observable_list.html
View
@@ -452,8 +452,8 @@ function(arrayUtil, kernel, declare, listen, has, miscUtil, TouchScroll, hasClas
if(from != to){ // if from and to are identical, it is an in-place update and we don't want to alter the rowIndex at all
firstRow.rowIndex--; // adjust the rowIndex so adjustRowIndices has the right starting point
}
- self.removeRow(row); // now remove
}
+ self.removeRow(row); // now remove
}
// the removal of rows could cause us to need to page in more items
if(self._processScroll){
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test List Observable Cases</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="viewport" content="width=570" />
+ <style type="text/css">
+ @import "../../dojo/resources/dojo.css";
+ @import "../css/dgrid.css";
+ @import "../css/skins/claro.css";
+ #list{
+ width: 300px;
+ }
+ </style>
+ <script type="text/javascript" src="../../dojo/dojo.js"
+ data-dojo-config="async: true"></script>
+ <script type="text/javascript">
+ require(["dojo/on", "dgrid/List", "put-selector/put", "dgrid/test/data/base", "dojo/_base/declare", "dojo/domReady!"],
+ function(on, List, put, testStore, declare, arrayUtil){
+
+ window.list = new List({
+ renderRow: function(object){
+ return put("div", object.col1 + object.col2);
+ }
+ },"list");
+ list.renderArray(testStore.query({id:1}));
+ on(document.getElementById("remove"), "click", function(){
+ testStore.remove(1);
+ });
+ });
+ </script>
+ </head>
+ <body class="claro">
+ <div id="grid"></div>
+ <div id="list"></div>
+ <button id="remove">Remove row 1</button>
+ </body>
+</html>

0 comments on commit 7d5db84

Please sign in to comment.