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
b3b11514
Commit
b3b11514
authored
Aug 06, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished draft implementation of GridView.
parent
ca35bb05
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
147 additions
and
57 deletions
+147
-57
Application.php
framework/yii/base/Application.php
+1
-1
classes.php
framework/yii/classes.php
+4
-4
CheckboxColumn.php
framework/yii/grid/CheckboxColumn.php
+11
-2
Column.php
framework/yii/grid/Column.php
+2
-2
DataColumn.php
framework/yii/grid/DataColumn.php
+23
-9
GridView.php
framework/yii/grid/GridView.php
+103
-37
GridViewAsset.php
framework/yii/grid/GridViewAsset.php
+1
-1
SerialColumn.php
framework/yii/grid/SerialColumn.php
+2
-1
No files found.
framework/yii/base/Application.php
View file @
b3b11514
...
@@ -169,7 +169,7 @@ abstract class Application extends Module
...
@@ -169,7 +169,7 @@ abstract class Application extends Module
public
function
registerErrorHandlers
()
public
function
registerErrorHandlers
()
{
{
if
(
YII_ENABLE_ERROR_HANDLER
)
{
if
(
YII_ENABLE_ERROR_HANDLER
)
{
ini_set
(
'display_errors'
,
0
);
//
ini_set('display_errors', 0);
set_exception_handler
(
array
(
$this
,
'handleException'
));
set_exception_handler
(
array
(
$this
,
'handleException'
));
set_error_handler
(
array
(
$this
,
'handleError'
),
error_reporting
());
set_error_handler
(
array
(
$this
,
'handleError'
),
error_reporting
());
if
(
$this
->
memoryReserveSize
>
0
)
{
if
(
$this
->
memoryReserveSize
>
0
)
{
...
...
framework/yii/classes.php
View file @
b3b11514
...
@@ -230,10 +230,10 @@ return array(
...
@@ -230,10 +230,10 @@ return array(
'yii\widgets\ContentDecorator'
=>
YII_PATH
.
'/widgets/ContentDecorator.php'
,
'yii\widgets\ContentDecorator'
=>
YII_PATH
.
'/widgets/ContentDecorator.php'
,
'yii\widgets\DetailView'
=>
YII_PATH
.
'/widgets/DetailView.php'
,
'yii\widgets\DetailView'
=>
YII_PATH
.
'/widgets/DetailView.php'
,
'yii\widgets\FragmentCache'
=>
YII_PATH
.
'/widgets/FragmentCache.php'
,
'yii\widgets\FragmentCache'
=>
YII_PATH
.
'/widgets/FragmentCache.php'
,
'yii\
widgets\grid\CheckboxColumn'
=>
YII_PATH
.
'/widgets
/grid/CheckboxColumn.php'
,
'yii\
grid\CheckboxColumn'
=>
YII_PATH
.
'
/grid/CheckboxColumn.php'
,
'yii\
widgets\grid\Column'
=>
YII_PATH
.
'/widgets
/grid/Column.php'
,
'yii\
grid\Column'
=>
YII_PATH
.
'
/grid/Column.php'
,
'yii\
widgets\grid\DataColumn'
=>
YII_PATH
.
'/widgets
/grid/DataColumn.php'
,
'yii\
grid\DataColumn'
=>
YII_PATH
.
'
/grid/DataColumn.php'
,
'yii\
widgets\GridView'
=>
YII_PATH
.
'/widgets
/GridView.php'
,
'yii\
grid\GridView'
=>
YII_PATH
.
'/grid
/GridView.php'
,
'yii\widgets\InputWidget'
=>
YII_PATH
.
'/widgets/InputWidget.php'
,
'yii\widgets\InputWidget'
=>
YII_PATH
.
'/widgets/InputWidget.php'
,
'yii\widgets\LinkPager'
=>
YII_PATH
.
'/widgets/LinkPager.php'
,
'yii\widgets\LinkPager'
=>
YII_PATH
.
'/widgets/LinkPager.php'
,
'yii\widgets\LinkSorter'
=>
YII_PATH
.
'/widgets/LinkSorter.php'
,
'yii\widgets\LinkSorter'
=>
YII_PATH
.
'/widgets/LinkSorter.php'
,
...
...
framework/yii/
widgets/
grid/CheckboxColumn.php
→
framework/yii/grid/CheckboxColumn.php
View file @
b3b11514
...
@@ -5,19 +5,28 @@
...
@@ -5,19 +5,28 @@
* @license http://www.yiiframework.com/license/
* @license http://www.yiiframework.com/license/
*/
*/
namespace
yii\
widgets\
grid
;
namespace
yii\grid
;
use
Closure
;
use
Closure
;
use
yii\base\InvalidConfigException
;
use
yii\base\InvalidConfigException
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
/**
/**
* CheckboxColumn displays a column of checkboxes in a grid view.
* Users may click on the checkboxes to select rows of the grid. The selected rows may be
* obtained by calling the following JavaScript code:
*
* ~~~
* var keys = $('#grid').yiiGridView('getSelectedRows');
* // keys is an array consisting of the keys associated with the selected rows
* ~~~
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
class
CheckboxColumn
extends
Column
class
CheckboxColumn
extends
Column
{
{
public
$name
;
public
$name
=
'selection'
;
public
$checkboxOptions
=
array
();
public
$checkboxOptions
=
array
();
public
$multiple
=
true
;
public
$multiple
=
true
;
...
...
framework/yii/
widgets/
grid/Column.php
→
framework/yii/grid/Column.php
View file @
b3b11514
...
@@ -5,14 +5,14 @@
...
@@ -5,14 +5,14 @@
* @license http://www.yiiframework.com/license/
* @license http://www.yiiframework.com/license/
*/
*/
namespace
yii\
widgets\
grid
;
namespace
yii\grid
;
use
Closure
;
use
Closure
;
use
yii\base\Object
;
use
yii\base\Object
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\widgets\GridView
;
/**
/**
* Column is the base class of all [[GridView]] column classes.
*
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
...
...
framework/yii/
widgets/
grid/DataColumn.php
→
framework/yii/grid/DataColumn.php
View file @
b3b11514
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
* @license http://www.yiiframework.com/license/
* @license http://www.yiiframework.com/license/
*/
*/
namespace
yii\
widgets\
grid
;
namespace
yii\grid
;
use
yii\base\InvalidConfigException
;
use
yii\base\Model
;
use
yii\base\Model
;
use
yii\data\ActiveDataProvider
;
use
yii\data\ActiveDataProvider
;
use
yii\db\ActiveQuery
;
use
yii\db\ActiveQuery
;
...
@@ -20,8 +20,22 @@ use yii\helpers\Inflector;
...
@@ -20,8 +20,22 @@ use yii\helpers\Inflector;
*/
*/
class
DataColumn
extends
Column
class
DataColumn
extends
Column
{
{
/**
* @var string the attribute name associated with this column. When neither [[content]] nor [[value]]
* is specified, the value of the specified attribute will be retrieved from each data model and displayed.
*
* Also, if [[header]] is not specified, the label associated with the attribute will be displayed.
*/
public
$attribute
;
public
$attribute
;
/**
* @var \Closure an anonymous function that returns the value to be displayed for every data model.
* If this is not set, `$model[$attribute]` will be used to obtain the value.
*/
public
$value
;
public
$value
;
/**
* @var string in which format should the value of each data model be displayed as (e.g. "text", "html").
* Supported formats are determined by the [[GridView::formatter|formatter]] used by the [[GridView]].
*/
public
$format
;
public
$format
;
/**
/**
* @var boolean whether to allow sorting by this column. If true and [[attribute]] is found in
* @var boolean whether to allow sorting by this column. If true and [[attribute]] is found in
...
@@ -30,13 +44,13 @@ class DataColumn extends Column
...
@@ -30,13 +44,13 @@ class DataColumn extends Column
*/
*/
public
$enableSorting
=
true
;
public
$enableSorting
=
true
;
/**
/**
* @var string|array|boolean the HTML code representing a filter input (e
g
a text field, a dropdown list)
* @var string|array|boolean the HTML code representing a filter input (e
.g.
a text field, a dropdown list)
* that is used for this data column. This property is effective only when
* that is used for this data column. This property is effective only when
[[GridView::filterModel]] is set.
*
{@link CGridView::filter} is set.
*
* If this property is not set, a text field will be generated as the filter input;
*
-
If this property is not set, a text field will be generated as the filter input;
* If this property is an array, a dropdown list will be generated that uses this property value as
*
-
If this property is an array, a dropdown list will be generated that uses this property value as
* the list options.
*
the list options.
*
If you don't want a filter for this data column, set this value to
false.
*
- If you don't want a filter for this data column, set this value to be
false.
*/
*/
public
$filter
;
public
$filter
;
...
...
framework/yii/
widgets
/GridView.php
→
framework/yii/
grid
/GridView.php
View file @
b3b11514
This diff is collapsed.
Click to expand it.
framework/yii/
widgets/
grid/GridViewAsset.php
→
framework/yii/grid/GridViewAsset.php
View file @
b3b11514
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* @license http://www.yiiframework.com/license/
* @license http://www.yiiframework.com/license/
*/
*/
namespace
yii\
widgets\
grid
;
namespace
yii\grid
;
use
yii\web\AssetBundle
;
use
yii\web\AssetBundle
;
...
...
framework/yii/
widgets/
grid/SerialColumn.php
→
framework/yii/grid/SerialColumn.php
View file @
b3b11514
...
@@ -5,10 +5,11 @@
...
@@ -5,10 +5,11 @@
* @license http://www.yiiframework.com/license/
* @license http://www.yiiframework.com/license/
*/
*/
namespace
yii\
widgets\
grid
;
namespace
yii\grid
;
/**
/**
* SerialColumn displays a column of row numbers (1-based).
* SerialColumn displays a column of row numbers (1-based).
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
* @since 2.0
*/
*/
...
...
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