new tab onClick

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8.4/dijit/themes/tundra/tundra.css">
<div id="mainPane"></div>

CSS

html, body {
    font:90% helvetica, arial, sans-serif;
    height:100%;
    margin:0;
    overflow:hidden;
    width:100%
}
.dgrid-column-set-cell.dgrid-column-set-0 {
    width:134px
}
#grid {
    height:100%
}
.dgrid-column-set-0 .dgrid-column-set {
    height:115px
}
.dgrid-column-0-0-0.field-id span {
    display:block;
    height:108px;
    width:126px
}
.dgrid-column-1-0-0.field-color {
    font-weight:bold
}
.label {
    text-align:right
}
.formTable {
    border-collapse:separate;
    border-spacing:12px
}
#mainPane {
    height:100%;
    width:100%
}

JavaScript

require({
    packages: [{
        name: "dgrid",
        location: "http://dojofoundation.org/packages/dgrid/js/dgrid"
    }, {
        name: "put-selector",
        location: "http://dojofoundation.org/packages/dgrid/js/put-selector"
    }, {
        name: "xstyle",
        location: "http://dojofoundation.org/packages/dgrid/js/xstyle"
    }]
});
require([
    "dojo/on",
    "dojo/_base/declare",
    "dojo/store/Memory",
    "dijit/form/Form",
    "dijit/form/TextBox",
    "dijit/layout/ContentPane",
    "dijit/layout/TabContainer",
    "dgrid/Keyboard",
    "dgrid/OnDemandGrid",
    "dgrid/ColumnSet",
    "dgrid/extensions/DijitRegistry",
    "dojo/domReady!"], function (on, declare, Memory, Form, TextBox, ContentPane, TabContainer, Keyboard, OnDemandGrid, ColumnSet, DijitRegistry) {
    var tabPane = new TabContainer({
        region: 'center'
    }, 'mainPane'),
        search = new ContentPane({
            id: 'searchTab',
            title: 'Search',
            closable: false,
            content: '<div id="grid"></div>'
        }),
        c = 0,
        colors, columns, content, grid, listener;
    tabPane.startup();
    tabPane.addChild(search);
colors = new Memory({
        data: [{
            id: '#FE2712',
            color: 'Red',
            pos: 'Primary',
            R: 254,
            G: 39,
            B: 18
        }, {
            id: '#FF110B',
            color: 'Scarlet',
            pos: 'Quaternary',
            R: 255,
            G: 17,
            B: 11
        }, {
            id: '#FF5B31',
            color: 'Vermilion',
            pos: 'Tertiary',
            R: 255,
            G: 91,
            B: 49
        }, {
            id: '#FFA040',
            color: 'Orange',
            pos: 'Secondary',
            R: 255,
            G: 160,
            B: 64
        }, {
            id: '#FFD631',
            color: 'Amber',
            pos: 'Tertiary',
            R: 255,
            G: 214,
            B: 49
        }, {
  ...