Skip to main content

Calling Data Model Functions in Pages

Pages can directly invoke data model functions to perform CRUD operations on backend data. Using intuitive syntax, you can accomplish data reading, creation, updating, and deletion operations without complex API interface calls, significantly streamlining your data operation workflow.

Tutorial Reference

This document covers the fundamental syntax and concepts for data model function calls. For comprehensive illustrated tutorials, complete examples, and step-by-step visual guides, please refer to:

Page Customization - Calling Data Model Functions

Calling Syntax

Data model functions are called in exactly the same manner as service function calls, both utilizing the app object with consistent and streamlined syntax.

Basic Syntax in Full-Code Pages

// Within page class member functions
this.app.models.[ModelID].[MethodName]([Parameter1], [Parameter2], ...)

// Calling from other contexts
import { getRuntimeApp } from 'jit';
const app = getRuntimeApp();
app.models.[ModelID].[MethodName]([Parameter1], [Parameter2], ...)

Data Operation Capabilities

Data model functions empower pages with robust data operation capabilities, enabling complex data processing tasks through simple, unified syntax. To learn how to create and configure data models, please refer to: Data Table Model

JitAI AssistantBeta
Powered by JitAI