class Prostore::TUI::RecordGrid

Included Modules

Defined in:

prostore/tui/widgets/record_grid.cr

Constant Summary

MIN_COL_WIDTH = 8
PAGE_SIZE = 50

Constructors

Instance Method Summary

Constructor Detail

def self.new(browser : Browser) #

[View source]

Instance Method Detail

def content_size : Int32 #

Paginated (server-side), not scrolled — SplitWindow's scrollbar would be misleading if this reported @total, so it reports only what's on the current page (never more than fits in one screen).


[View source]
def handle_click(local_row : Int32, local_col : Int32, scroll : ::TUI::ScrollControl) : Bool #
Description copied from module TUI::Scrollable

A positional (mouse) event, pre-translated by Window into content-local row/col (0,0 = content's own first cell).


[View source]
def handle_key(ev : ::TUI::KeyEvent, scroll : ::TUI::ScrollControl) : Bool #
Description copied from module TUI::Scrollable

Everything but positional mouse hit-testing.


[View source]
def load_table(table : String) : Nil #

[View source]
def on_new_row : Proc(String, Nil) | Nil #

[View source]
def on_new_row=(on_new_row : Proc(String, Nil) | Nil) #

[View source]
def on_open_detail : Proc(String, String, Nil) | Nil #

[View source]
def on_open_detail=(on_open_detail : Proc(String, String, Nil) | Nil) #

[View source]
def reload : Nil #

[View source]
def render_content(buffer : ::TUI::Buffer, scroll : ::TUI::ScrollControl) : Nil #
Description copied from module TUI::Scrollable

Render into buffer, a region already sized to the content area (border/scrollbar column already excluded by Window). Row 0 is content's own first row.


[View source]
def search_active? : Bool #

[View source]
def selected_pk : String | Nil #

Returns the PK value of the currently highlighted row, or nil.


[View source]
def selected_value : String | Nil #

Pickable — used when this grid is wrapped as an FK picker.


[View source]
def status_hint : String #

[View source]
def table : String | Nil #

[View source]
def title : String #

[View source]