Comments (7)
Hope you have read the default yii guide. You may once want to do that.
This is addressed in yii\grid\CheckboxColumn... you need to write your javascript accordingly.
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
This is also highlighted in the Krajee Grid Documentation for Checkbox Column.
from yii2-dynagrid.
@kartik-v I already tried that but it gives me an error:
TypeError: $(...).yiiGridView is not a function
from yii2-dynagrid.
The error means you are using a wrong identifier for your grid. The HTML ID attribute must pertain to your gridview container.
For Dynagrid you set gridview widget properties via gridOptions
- hence you can access the grid ID attribute through gridOptions['options']['id']
. You may need to set a value for this and access. For example:
// widget php script
echo Dynagrid::widget([
'options' => ['id' => 'dynagrid'], // this is dynagrid identifier
'gridOptions' => ['options' => ['id' => 'grid']], // this is gridview identifier
// add other settings required by DYNAGRID
]);
Then access the same via javascript.
// js script
var keys = $('#grid').yiiGridView('getSelectedRows');
// keys is an array consisting of the keys associated with the selected rows
from yii2-dynagrid.
@kartik-v if I fix my javascript, it was because was inside the domready but now when I get the selected rows I get this error:
TypeError: data is undefined
if (data.selectionColumn) {
from yii2-dynagrid.
Sorry @kartik-v it worked now, it was a conflict name on both id's.
Thanks for the clarification. I would like to make a donation to you because I'm using a lot of your components and if you have the time I would like to hire you as a consultant.
from yii2-dynagrid.
I get this error :
Setting unknown property: kartik\grid\GridView::gridOptions
from yii2-dynagrid.
thanks a lot it's working fine
but if you may how I get the full row data using the key?
from yii2-dynagrid.
Related Issues (20)
- Composer install error HOT 1
- Dynagrid Floating Header blocks Date Picker HOT 1
- Correct grid pagination assignment HOT 4
- Save columns width in DB HOT 1
- The '' module MUST be setup in your Yii configuration file. HOT 4
- How to extend the class kartik\dynagrid\DynaGrid? HOT 1
- In Personalize Grid Configuration, duplicate "saving" after multipe click in apply HOT 1
- Enable Cache on DynaGridStore HOT 2
- How to check if a column is visible to the current user HOT 2
- CraftCMS - Twig Template HOT 1
- Personalize Grid Configuration Columns Drag and Drop Fails in Mobile Browsers HOT 2
- Feature Request - Allow for multiple stored dynagrid configurations HOT 1
- thrieufilter - StateBehavior don't work HOT 1
- Enhancements to support Bootstrap v5.x
- PHP8.1 strtolower error with null value
- defaultPageSize overrides dataProvider pageSize setting
- Enhance Dynagrid layout parts rendering to prevent wrong Bootstrap 5 plugin initializations. HOT 3
- Save/Edit Grid filter and sort has UI issues HOT 1
- Sort and Filter delete modals are hidden HOT 2
- array_sum(): Addition is not supported on type string when using showPageSummary HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-dynagrid.