Permalink
Browse files

Merge branch 'master' of github.com:clevertech/YiiBooster

  • Loading branch information...
hijarian committed Jul 8, 2013
2 parents 6c7724e + 254f586 commit 2bd36bf05d1ee653b028f4b3f8957d53b397cca1
@@ -258,7 +258,7 @@
settings = gridSettings[id]; settings = gridSettings[id];
$grid.addClass(settings.loadingClass); $grid.addClass(settings.loadingClass);
options = $.extend({ var localOptions = $.extend({
type: 'GET', type: 'GET',
url: $grid.yiiJsonGridView('getUrl'), url: $grid.yiiJsonGridView('getUrl'),
dataType: 'json', dataType: 'json',
@@ -339,31 +339,31 @@
} }
} }
}, options || {}); }, options || {});
if (options.data !== undefined && options.type === 'GET') { if (localOptions.data !== undefined && localOptions.type === 'GET') {
options.url = $.param.querystring(options.url, options.data); localOptions.url = $.param.querystring(localOptions.url, localOptions.data);
options.data = {}; localOptions.data = {};
} }
if (settings.ajaxUpdate !== false) { if (settings.ajaxUpdate !== false) {
options.url = $.param.querystring(options.url, settings.ajaxVar + '=' + id); localOptions.url = $.param.querystring(localOptions.url, settings.ajaxVar + '=' + id);
if (settings.beforeAjaxUpdate !== undefined) { if (settings.beforeAjaxUpdate !== undefined) {
settings.beforeAjaxUpdate(id, options); settings.beforeAjaxUpdate(id, localOptions);
} }
$.ajax(options); $.ajax(localOptions);
} else { // non-ajax mode } else { // non-ajax mode
if (options.type === 'GET') { if (options.type === 'GET') {
window.location.href = options.url; window.location.href = localOptions.url;
} else { // POST mode } else { // POST mode
$form = $('<form action="' + options.url + '" method="post"></form>').appendTo('body'); $form = $('<form action="' + localOptions.url + '" method="post"></form>').appendTo('body');
if (options.data === undefined) { if (localOptions.data === undefined) {
options.data = {}; localOptions.data = {};
} }
if (options.data.returnUrl === undefined) { if (localOptions.data.returnUrl === undefined) {
options.data.returnUrl = window.location.href; localOptions.data.returnUrl = window.location.href;
} }
$.each(options.data, function (name, value) { $.each(localOptions.data, function (name, value) {
$form.append($('<input type="hidden" name="t" value="" />').attr('name', name).val(value)); $form.append($('<input type="hidden" name="t" value="" />').attr('name', name).val(value));
}); });
$form.submit(); $form.submit();
View
@@ -110,15 +110,15 @@ protected function renderMenu($items)
} }
if (isset($item['items']) && !empty($item['items'])) { if (isset($item['items']) && !empty($item['items'])) {
$this->controller->widget( $dropdownOptions = array(
'bootstrap.widgets.TbDropdown', 'encodeLabel' => $this->encodeLabel,
array( 'htmlOptions' => isset($item['submenuOptions']) ? $item['submenuOptions']
'encodeLabel' => $this->encodeLabel, : $this->submenuHtmlOptions,
'htmlOptions' => isset($item['submenuOptions']) ? $item['submenuOptions'] 'items' => $item['items'],
: $this->submenuHtmlOptions,
'items' => $item['items'],
)
); );
$dropdownOptions['id'] = isset($dropdownOptions['htmlOptions']['id']) ?
$dropdownOptions['htmlOptions']['id'] : null;
$this->controller->widget('bootstrap.widgets.TbDropdown', $dropdownOptions);
} }
echo '</li>'; echo '</li>';
@@ -249,10 +249,7 @@ public function renderContent()
public function renderKeys() public function renderKeys()
{ {
$data = $this->dataProvider->getData(); $data = $this->dataProvider->getData();
if (empty($data)) {
return false;
}
if (!$this->sortableRows || !$this->getAttribute($data[0], (string)$this->sortableAttribute)) { if (!$this->sortableRows || !$this->getAttribute($data[0], (string)$this->sortableAttribute)) {
parent::renderKeys(); parent::renderKeys();
} }
@@ -52,7 +52,10 @@ class TbFormInputElement extends CFormInputElement
'uneditable' => 'uneditableRow', 'uneditable' => 'uneditableRow',
'radiolistinline' => 'radioButtonListInlineRow', 'radiolistinline' => 'radioButtonListInlineRow',
'checkboxlistinline' => 'checkBoxListInlineRow', 'checkboxlistinline' => 'checkBoxListInlineRow',
'select2' => 'select2Row' 'select2' => 'select2Row',
'wysihtml5' => 'html5EditorRow',
'toggle' => 'toggleButtonRow'
); );
/** /**

0 comments on commit 2bd36bf

Please sign in to comment.