AC-280, AC-289 Fixes

This commit is contained in:
chouseknecht 2013-07-28 06:16:12 -04:00
parent fce1a04a76
commit d1ad7d822d
4 changed files with 9 additions and 11 deletions

View File

@ -231,7 +231,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
$('input[type="checkbox"]').attr('disabled','disabled');
$('input[type="radio"]').attr('disabled','disabled');
$('#host_config_key-gen-btn').attr('disabled','disabled');
$('textarea').attr('disabled','disabled');
$('textarea').attr('readonly','readonly');
})
.error( function(data, status, headers, config) {
ProcessErrors(scope, data, status, form,

View File

@ -24,13 +24,14 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices'])
scope.selected = []; //array of selected row IDs
// toggle row selection
scope['toggle_' + list.iterator] = function(id) {
scope['toggle_' + list.iterator] = function(id, ischeckbox) {
for (var i=0; i < scope[list.name].length; i++) {
if (scope[list.name][i]['id'] == id) {
if (scope[list.name][i]['checked'] == '0') {
if ( (scope[list.name][i]['checked'] == '0' && !ischeckbox) || (scope[list.name][i]['checked'] == 1 && ischeckbox) ) {
// select the row
scope[list.name][i]['checked'] = '1';
scope[list.name][i]['success_class'] = 'success';
// add selected object to the array
var found = false;
for (var j=0; j < scope.selected.length; j++) {
@ -47,6 +48,7 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices'])
// unselect the row
scope[list.name][i]['checked'] = '0';
scope[list.name][i]['success_class'] = '';
// remove selected object from the array
for (var j=0; j < scope.selected.length; j++) {
if (scope.selected[j].id == id) {

View File

@ -101,12 +101,13 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
var field = list['fields'][fld];
var html = '';
html += "<td ";
//html += "<td ";
html += "<td class=\"" + fld + "-column";
html += (field['class']) ? " " + field['class'] : "";
html += (field['columnClass']) ? " " + field['columnClass'] : "";
html += "\" ";
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
html += ">\n";
// Add ngShow

View File

@ -220,7 +220,6 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
html += (list.orderBy) ? " | orderBy:'" + list.orderBy + "'" : "";
html += (list.filterBy) ? " | filter: " + list.filterBy : "";
html += "\"";
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
html += ">\n";
if (list.index) {
html += "<td class=\"index-column\">{{ $index + (" + list.iterator + "Page * " + list.iterator + "PageSize) + 1 }}.</td>\n";
@ -237,13 +236,9 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
}
if (options.mode == 'select' || options.mode == 'lookup') {
//html += "<td><input type=\"checkbox\" name=\"check_{{" + list.iterator + ".id }}\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
list.iterator + ".id }}\" ng-true-value=\"1\" ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
//ng-click=\"toggle_" + list.iterator +
// "({{ " + list.iterator + ".id }}, true)\"
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }}, true)\" ng-true-value=\"1\" " +
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
}
else if (options.mode == 'edit') {
// Row level actions