Piotr Labudda 9 лет назад
Родитель
Сommit
14f0717892
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      SE/se-lib/UI.php

+ 10 - 2
SE/se-lib/UI.php

@@ -118,8 +118,10 @@ class UI {
 			$cols = array_keys((array)$firstRow);
 		}
 		// if (empty($cols)) return;
+		$hiddenCols = V::get('hidden_cols', array(), $params);
+		$html_id = V::get('__html_id', '', $params);
 ?>
-	<table class="table table-bordered table-hover">
+	<table class="table table-bordered table-hover" <?php echo ($html_id)? 'id="' . $html_id . '"' : ''; ?>>
 	<?php if ($caption) : ?>
 		<caption><?php echo $caption; ?></caption>
 	<?php endif; ?>
@@ -129,17 +131,19 @@ class UI {
 				<th style="padding:2px">Lp.</th>
 			<?php endif; ?>
 			<?php foreach ($cols as $colName) : ?>
+				<?php if (in_array($colName, $hiddenCols)) continue; ?>
 				<th style="padding:2px"><?php echo $colName; ?></th>
 			<?php endforeach; ?>
 			</tr>
 		</thead>
 		<tbody>
 		<?php $i = 0; foreach ($rows as $row) : $i++; ?>
-			<tr>
+			<tr <?php echo (!empty($row['__js_on_click']))? 'onClick="' . $row['__js_on_click'] . '"' : ''; ?>>
 			<?php if ($showLp) : ?>
 				<td style="padding:2px; color:#ccc"><?php echo $i; ?></td>
 			<?php endif; ?>
 			<?php foreach ($cols as $colName) : ?>
+				<?php if (in_array($colName, $hiddenCols)) continue; ?>
 				<td style="padding:2px"><?php echo V::get($colName, '', $row); ?></td>
 			<?php endforeach; ?>
 			</tr>
@@ -149,4 +153,8 @@ class UI {
 <?php
 	}
 
+	public static function jsAjaxTable($params) {
+		
+	}
+
 }