Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue #6491 - Modal dialogs in attribute control do not close a…
…fter use or reload grid

Dev - some new translations required
  • Loading branch information
jcleeland committed Aug 16, 2012
1 parent 7e49096 commit a541050
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
@@ -1,4 +1,8 @@
<script type="text/javascript">
var deleteCaption = "<?php $clang->eT("Delete attribute") ?>";
var deleteMsg = "<?php $clang->eT("Delete selected attribute(s) and it's associated data?") ?>";
var addCaption = "<?php $clang->eT("Add attribute") ?>";

var attributeInfoUrl = "<?php echo Yii::app()->getController()->createUrl("admin/participants/getAttributeInfo_json"); ?>";
var editAttributeUrl = "<?php echo Yii::app()->getController()->createUrl("admin/participants/editAttributeInfo"); ?>";
var attributeControlCols = '["<?php $clang->eT('Actions'); ?>", "<?php $clang->eT('Attribute name'); ?>", "<?php $clang->eT('Attribute type'); ?>", "<?php $clang->eT('Visible in participants panel'); ?>"]';
Expand Down
45 changes: 30 additions & 15 deletions scripts/admin/attributeControl.js
Expand Up @@ -30,32 +30,47 @@ $(document).ready(function() {
});

jQuery.extend($.fn.fmatter , {
rowactions : function(rid,gid,act) {
rowactions : function(rid,gid,act, pos) {
var delOptions = {
caption: deleteCaption,
msg: deleteMsg,
reloadAfterSubmit: true,
width: 400
};
switch(act)
{
case 'edit' :
window.open(attributeEditUrl + '/' + rid, '_top');
break;
case 'del':
$('#'+gid).jqGrid('delGridRow', rid);
$('#'+gid).jqGrid('delGridRow', rid, delOptions);
break;
}
}
});

jQuery('#attributeControl').jqGrid('navGrid',
'#pager',
{add:true, del:true, edit:true},
{closeAfterAdd: true
}, //Add options
{ width:400,
reloadAfterSubmit: true,
afterSubmit: function (response) {
return [true, '', response.responseText];
}
}, //Del options
{}, //Edit options
{multipleSearch:true, width:600},
jQuery('#attributeControl').jqGrid('navGrid', '#pager',
{ add:true,
edit:false,
del:true},
{}, //Default settings for edit
{ addCaption: addCaption,
closeAfterAdd: true,
width: 400,
afterSubmit: function () {
$(this).jqGrid('setGridParam', {datatype: 'json'});
return [true,'',false]; //no error and no new rowid
},
}, //default settings for add
{ reloadAfterSubmit: true,
caption: deleteCaption,
msg: deleteMsg,
width: 500
}, //Default settings for delete
{ multipleSearch:true,
width:600,
closeAfterSearch: true,
closeAfterReset: true}, //Default settings for search
{closeAfterAdd:true}
);

Expand Down

0 comments on commit a541050

Please sign in to comment.