Javascript dojox.grid.DataGrid按列选择一行';s值

Javascript dojox.grid.DataGrid按列选择一行';s值,javascript,dojo,Javascript,Dojo,我不熟悉dojo。我使用的这个应用程序有一个dojo数据网格 <table jsid="grid" id="grid" dojoType="dojox.grid.DataGrid" store="store" clientSort="true" style="height: 400px;" rowsPerPage="10" postrender="setTableCount(store,'count');" > <thead> <t

我不熟悉dojo。我使用的这个应用程序有一个dojo数据网格

    <table jsid="grid" id="grid" dojoType="dojox.grid.DataGrid" store="store"
    clientSort="true" style="height: 400px;"  rowsPerPage="10"
    postrender="setTableCount(store,'count');"
    >
<thead>
<tr>
    <th field="enabled" width="24px" styles='text-align: center;'
        celltype="dojox.grid.cells.Bool" formatter="formatterEnabled"
        dojoType="dijit.form.CheckBox"><img src='../common/images/check-16.png' title='Enabled'/></th>
    <th field="number" width="100px" >Number</th>

    <th field="name" width="100px" >Name</th>
    <th field="extension" width="100px" >Extension</th>
    <th field="type" width="100px" >Type</th>
    <th field="deleted" width="20px"
        formatter="formatterZombieSkill">
        <img src='../common/images/blocks-delete-16.png' title='Marked for deletion'/></th>
</tr>
</thead>

你们中的一位dojo大师能帮我解决缺少的select语句吗?

我不是dojo大师,但如果您试图通过编程选择行,这可能会满足您的需要。。。我认为DataGrid包含dojox.grid.Selection的一个实例

选择dijit有一个名为setSelected的方法,我相信它会为selected/notselected获取一个索引和一个布尔值。所以我认为你可以:

dijit.byId("grid").selection.setSelected(i, true);

我还没有测试过它,但我认为这将完成您需要的选择/突出显示。试试看,让我知道它是否有效。

Hmmm。。。我想知道网格是否包含对数组中某个位置的行的引用,您可以查询这些行。。。我对这个不太熟悉。如果不是。。。您可以同时包含它生成的行吗?看起来您刚刚粘贴了上面的标题。@JasonStoltz-谢谢您的评论!我最近没有登记入住。下周我将尝试你的建议-忙碌的周末:)我在Firefox中安装了firebug,并意识到仅仅在UI中不可能做到这一点,因为随着我移动滚动条拇指,网格的内容会发生变化。当我有空闲时间的时候,我得好好研究一下。
dijit.byId("grid").selection.setSelected(i, true);