ui.popupRecord in einer Untertabelle
Wenn ich bei meinen Untertabellen (z.b. Angebote.Angebotspositionen) in folgendem Fenster zwischen den Positionen in der Ansicht wechseln möchte, dann öffnet sich jedes mal ein neues Fenster. Das möchte ich gerne ändern.

Meine Idee war eine HTML-Ansicht statt Ninox-Ansicht und dann mit ui.popupRecord. Zusätzlich irgendwas mit closeRecord, aber soweit komme ich noch gar nicht. In meinen anderen HTML Tabellen funktioniert der Code, aber nicht in der Untertabelle. Dort passiert nichts, wenn ich auf die Spalten der HTML-Ansicht klicke.
Was mache ich falsch? Und falls es einen einfacheren Weg gibt, dass sich nicht für jede Position ein neues Fenster öffnet, gerne her damit ;)
let me := this;
let offers := me.Angebote.Positionen;
let css := "<style>
body { font-family:system-ui, sans-serif; margin:0; padding:0; }
.table-container { background:#fff; border-radius:8px; box-shadow:0 2px 5px rgba(0,0,0,0.1); padding:12px; max-width:100%; overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:12px; table-layout:fixed; }
th { text-align:left; background:#f1f5f9; padding:6px; border-bottom:2px solid #e2e8f0; }
td { padding:6px; border-bottom:1px solid #e2e8f0; word-wrap:break-word; }
tr:hover { background:#f8fafc; cursor:pointer; }
.link { color:#1f7aff; font-weight:500; text-decoration:none; }
/* kleine Anpassungen für Smartphones */
@media (max-width: 600px) {
table { font-size:11px; }
th, td { padding:4px; }
}
</style>";
let body := ---
<div class='table-container'>
<h3>Angebotspositionen</h3>
<table>
<thead>
<tr>
<th>Position</th>
<th>Dienstleistung</th>
<th>Menge</th>
<th>Einheit</th>
<th>Preis netto</th>
<th>Gesamtpreis netto</th>
</tr>
</thead>
<tbody>{ for o in offers do }
<tr onclick=ui.popupRecord('{ o }')>
<td>{ o.Position }</td>
<td>{ o.Dienstleistung }</td>
<td>{ o.Menge }</td>
<td>{ o.Einheit }</td>
<td>{ o.'Preis netto' }</td>
<td>{ o.'Gesamtpreis Netto' }</td>
</tr>{ end }
</tbody>
</table>
</div>
---;
html(css + body)
8 Antworten
-
<tr onclick="ui.popupRecord('{ string(o) }')">So müsste es funktionieren
-
Hallo Wenn es kleine Tabellen sind (meine Personaltabelle, Wartungsbuch für Geräte) und ich innerhalb der Records navigieren möchte, dann benutze ich dynamische Auswahlfelder, die im Record ganz oben stehen. Ich bleibe also in der Formularansicht und wechsle nicht auf die Tabellenansicht oder Ansichten. Klicke ich dann auf eine Auswahl, dann wird über einen Trigger (openRecord()) der gewählte angezeigt. Das ist bei mir durch ein paar Tricks bis ca. 40 Records (Wartungskalender für Geräte) hilfreich - also übersichtlich genug.
Eine Sonderform ist die Nutzung einer Rückverknüpfung mit Anzeige als "Eingebettet". Z.B. von einer Page oder einer Tabelle aus. Damit ist es auch recht einfach und du kannst den gewählten Record auch bearbeiten. Dafür habe ich persönlich keinen Anwendungsfall. In der angelegten Datei habe ich mal als Idee so deine Tabellen nachgestellt unter dem Reiter "admin" in der Tabelle "Angebot" ist das zu sehen. Demzufolge brauchst du die Tabelle "Angebotspositionen" nicht mehr öffnen und arbeitest nur noch nach Auswahl des Projekts gleich in der Tabelle "Angebote". Ist nur so eine Idee. Mirko
-
Now that Ninext is an official plugin, you can use it to add the ability to redirect the table/record that opens when you click in a view. Take a look at the docs. It works really well.
-
thank's for the heads-up, i didn't now about the plugin yet.
i have spent some hours trying to understand how to implement the ninext functions in the past and find it really hard to understand. (being very inexperienced with scripting)
could you give me a hint what i would need to do in order to achieve my current goal? (View table of Angebote.Positionen with the function, that the current record closes and the selected record opens once i click on one of the records)
Content aside
- vor 10 StundenZuletzt aktiv
- 8Antworten
- 25Ansichten
-
4
Folge bereits
