File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function setConfirm($operation, $message)
67
67
{
68
68
$ message = $ this ->translate ($ message );
69
69
$ this ->grid ->onRender [] = function (Grid $ grid ) use ($ operation , $ message ) {
70
- $ grid ['form ' ][Operation::ID ][Operation::ID ]->controlPrototype ->data ["grido- $ operation " ] = $ message ;
70
+ $ grid ['form ' ][Operation::ID ][Operation::ID ]->controlPrototype ->data ["grido-confirm- $ operation " ] = $ message ;
71
71
};
72
72
73
73
return $ this ;
Original file line number Diff line number Diff line change 341
341
342
342
onSubmit : function ( )
343
343
{
344
- var hasConfirm = this . getSelect ( ) . data ( ' grido-' + this . getSelect ( ) . val ( ) ) ;
344
+ var hasConfirm = this . getSelect ( ) . attr ( 'data- grido-confirm -' + this . getSelect ( ) . val ( ) ) ;
345
345
if ( hasConfirm ) {
346
346
if ( confirm ( hasConfirm . replace ( / % i / g, $ ( this . selector + ':checked' , this . grido . $table ) . length ) ) ) {
347
347
return true ;
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ class OperationTest extends \Tester\TestCase
23
23
Helper::grid (function (Grid $ grid ) {
24
24
$ grid ->setModel (array ());
25
25
$ grid ->addColumnText ('column ' , 'Column ' );
26
- $ grid ->setOperation (array ('edit ' => 'Edit ' , 'del ' => 'Del ' ), function () {})
27
- ->setConfirm ('del ' , 'Are you sure? ' );
26
+ $ grid ->setOperation (array ('edit ' => 'Edit ' , 'delete ' => 'Delete ' ), function () {})
27
+ ->setConfirm ('delete ' , 'Are you sure? ' );
28
28
$ grid ->render ();
29
29
})->run ();
30
30
31
31
$ formControl = Helper::$ grid ['form ' ][Operation::ID ][Operation::ID ];
32
- Assert::same ($ formControl ->controlPrototype ->data ['grido-del ' ], 'Are you sure? ' );
32
+ Assert::same ($ formControl ->controlPrototype ->data ['grido-confirm-delete ' ], 'Are you sure? ' );
33
33
}
34
34
35
35
/**********************************************************************************************/
You can’t perform that action at this time.
0 commit comments