Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
e8307085
Commit
e8307085
authored
Mar 04, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2612 from tof06/master
Add an option to ignore pjax request on some links.
parents
4b20fdc7
078fdab6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
jquery.pjax.js
framework/assets/pjax/jquery.pjax.js
+6
-0
ActionColumn.php
framework/grid/ActionColumn.php
+3
-0
Pjax.php
framework/widgets/Pjax.php
+2
-0
No files found.
framework/assets/pjax/jquery.pjax.js
View file @
e8307085
...
...
@@ -44,6 +44,8 @@
// event - "click" jQuery.Event
// options - pjax options
//
// If the click event target has 'data-pjax="0"' attribute, the event is ignored, and no pjax call is made.
//
// Examples
//
// $(document).on('click', 'a', $.pjax.click)
...
...
@@ -61,6 +63,10 @@
var
link
=
event
.
currentTarget
// Ignore links with data-pjax="0"
if
(
$
(
link
).
data
(
'pjax'
)
==
0
)
return
if
(
link
.
tagName
.
toUpperCase
()
!==
'A'
)
throw
"$.fn.pjax or $.pjax.click requires an anchor element"
...
...
framework/grid/ActionColumn.php
View file @
e8307085
...
...
@@ -88,6 +88,7 @@ class ActionColumn extends Column
$this
->
buttons
[
'view'
]
=
function
(
$url
,
$model
)
{
return
Html
::
a
(
'<span class="glyphicon glyphicon-eye-open"></span>'
,
$url
,
[
'title'
=>
Yii
::
t
(
'yii'
,
'View'
),
'data-pjax'
=>
'0'
,
]);
};
}
...
...
@@ -95,6 +96,7 @@ class ActionColumn extends Column
$this
->
buttons
[
'update'
]
=
function
(
$url
,
$model
)
{
return
Html
::
a
(
'<span class="glyphicon glyphicon-pencil"></span>'
,
$url
,
[
'title'
=>
Yii
::
t
(
'yii'
,
'Update'
),
'data-pjax'
=>
'0'
,
]);
};
}
...
...
@@ -104,6 +106,7 @@ class ActionColumn extends Column
'title'
=>
Yii
::
t
(
'yii'
,
'Delete'
),
'data-confirm'
=>
Yii
::
t
(
'yii'
,
'Are you sure to delete this item?'
),
'data-method'
=>
'post'
,
'data-pjax'
=>
'0'
,
]);
};
}
...
...
framework/widgets/Pjax.php
View file @
e8307085
...
...
@@ -25,6 +25,8 @@ use yii\web\Response;
* You may configure [[linkSelector]] to specify which links should trigger pjax, and configure [[formSelector]]
* to specify which form submission may trigger pjax.
*
* You may disable pjax for a specific link inside the container by adding `data-pjax="0"` attribute to this link.
*
* The following example shows how to use Pjax with the [[\yii\gridview\GridView]] widget so that the grid pagination,
* sorting and filtering can be done via pjax:
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment