Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ajax数据表在行上创建链接_Ajax_Jquery Datatables - Fatal编程技术网

ajax数据表在行上创建链接

ajax数据表在行上创建链接,ajax,jquery-datatables,Ajax,Jquery Datatables,我正在将数据传递到datatable $records["data"][] = array( '<input type="checkbox" name="id[]" value="'.$id.'">', $id, '12/09/2013', 'Jhon Doe', 'Jhon Doe', '45

我正在将数据传递到datatable

$records["data"][] = array(
                '<input type="checkbox" name="id[]" value="'.$id.'">',
                $id,
                '12/09/2013',
                'Jhon Doe',
                'Jhon Doe',
                '450.60$',
                rand(1, 10),
                '<span class="label label-sm label-'.(key($status)).'">'.(current($status)).'</span>',
                '<a href="javascript:;" class="btn btn-xs default"><i class="fa fa-search"></i> View</a>',
            );
$records[“data”][]=数组(
'',
$id,
'12/09/2013',
“约翰·多伊”,
“约翰·多伊”,
'450.60$',
兰特(1,10),
“(当前($状态))。”,
'',
);
我想添加到每个表行链接,这意味着您可以单击datatable行并将指向某个url,每个
url都将不同(我必须设置该url)。我的问题是如何设置
ulr

链接到您的详细信息页面(例如,我称之为
dataitem.php
),并在查询字符串中传递id:

'<a href="dataitem.php?id='.$id.'" class="btn btn-xs default">View</a>'
“”
然后,在
dataitem.php
中,从查询字符串中读取id,以便知道要显示哪一行。

链接到您的详细信息页面(例如,我称之为
dataitem.php
),并在查询字符串中传递id:

'<a href="dataitem.php?id='.$id.'" class="btn btn-xs default">View</a>'
“”
然后,在
dataitem.php
中,从查询字符串中读取id,以便知道要显示哪一行。

链接到您的详细信息页面(例如,我称之为
dataitem.php
),并在查询字符串中传递id:

'<a href="dataitem.php?id='.$id.'" class="btn btn-xs default">View</a>'
“”
然后,在
dataitem.php
中,从查询字符串中读取id,以便知道要显示哪一行。

链接到您的详细信息页面(例如,我称之为
dataitem.php
),并在查询字符串中传递id:

'<a href="dataitem.php?id='.$id.'" class="btn btn-xs default">View</a>'
“”

然后,在
dataitem.php
中,从查询字符串中读取id,以便知道要显示哪一行。

您可以使用datatable的fnRowCallback事件并将click事件绑定到每一行

    var oTable = $('#data').dataTable({
          "fnRowCallback": function (nRow, aData, iDisplayIndex) {

                // Bind click event
                $(nRow).click(function() {
                      window.open('http://example.com');

                      //OR

                     window.open(aData.url);

                });

                return nRow;
           }
    });

您可以使用datatable的fnRowCallback事件并将click事件绑定到每一行

    var oTable = $('#data').dataTable({
          "fnRowCallback": function (nRow, aData, iDisplayIndex) {

                // Bind click event
                $(nRow).click(function() {
                      window.open('http://example.com');

                      //OR

                     window.open(aData.url);

                });

                return nRow;
           }
    });

您可以使用datatable的fnRowCallback事件并将click事件绑定到每一行

    var oTable = $('#data').dataTable({
          "fnRowCallback": function (nRow, aData, iDisplayIndex) {

                // Bind click event
                $(nRow).click(function() {
                      window.open('http://example.com');

                      //OR

                     window.open(aData.url);

                });

                return nRow;
           }
    });

您可以使用datatable的fnRowCallback事件并将click事件绑定到每一行

    var oTable = $('#data').dataTable({
          "fnRowCallback": function (nRow, aData, iDisplayIndex) {

                // Bind click event
                $(nRow).click(function() {
                      window.open('http://example.com');

                      //OR

                     window.open(aData.url);

                });

                return nRow;
           }
    });