获取网格中当前行的ID

时间:2014-09-16 04:41:22

标签: php yii

我试图获取当前行ID ID编辑图标

请查找TableWidgets文件,如下面的链接所示 https://drive.google.com/folderview?id=0BwtwIV52Ve6kRFBJdkFCY0NvQUk&usp=sharing

的index.php

 <script type="text/javascript">
$(document).ready(function() { 
    $('#list-grid table td div [action=tw-edit]').click(function(event) {
        var rowId =$(this).closest("div.list-grid").attr("id");
        alert (rowIdx);

    });     
});
</script>
 <?php $this->beginWidget('application.widgets.TableWidget', 
        array(      
         'dataProvider'=>$dataProvider,
         'fixedHead' => true,
         'id' => 'list-grid',                   
        )); 
 ?> 
<?php $this->endWidget(); ?> 

Grid.HTML

<div id="list-grid" class="box nominimize tablewidget" url/default/index">
            <div class="content noPad">
                <div class=" table-for-split" heightforsplit="200px">
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th class=" sorting" sortfield="id"></th>
                                <th class=" sorting" sortfield="dateordered"></th>
                                <th class="" sortfield="qty"></th>
                                <th class=" sorting" sortfield="tag"></th>
                                <th class="" sortfield="is_active"></th>
                                <th class="" sortfield="created"></th>
                                <th class="" sortfield="createdby"></th>
                                <th class="" sortfield="description"></th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>10001</td>
                                <td></td>
                                <td>5</td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td> action=tw-edit</td>
                            </tr>
                            <tr></tr>
                        </tbody>
                    </table>
                </div>
            </div>

请任何人帮忙解决此问题。

0 个答案:

没有答案
相关问题