Clone wiki

ExtJSPackages / Server URL Placeholders

This package allows placeholders in the URLs configured in a server proxy.

Released under GPLv3.

The motivation of this package was the necessity to load data from REST services with path variables in the form: /route/${foo}/and/${bar.baz}/and/maybe/id

With this package you have to configure the URLs for a server (in the form of a proxy, for example):

proxy: {
  type: 'rest',
  url: '/controller/${param1}/blah/${more.param2}'
or with the api option:
proxy: {
  type: 'rest',
  api: {
    create  : '/controller/new/${owner}/${}',
    read    : '/controller/load',
    update  : '/controller/update',
    destroy : '/controller/destroy_action'

To set the parameter values, they can be configured with a default parameters values with extraParams:

proxy: {
  type: 'rest',
  url: '/controller/${param1}/blah/${more.param2}',
  extraParams: {
    param1: 'blah',
    more: {
      param2: 'bleh'
or programmatically:
store.getProxy().extraParams = {...} ;

Those default values will be overriden with the load config parameter. It can be configured when loading stores and models:

// With a store
  params: {
      group: 3,
      type: 'user'
  callback: function(records, operation, success) {
      // do something after the load finishes
  scope: this

// With a model
model.load(id_or_null, {
  params: {
    parameter1: ...
}) ;

##Warning for REST proxy server and appendId## This package includes a modification on appendId parameter behaviour. When appendId === false, the query parameter ?id=... it will not be appended to the URL string. When appendId === false, it is still possible to configure a placeholder like foo/${id}/bar/baz.

##How to install##

Install the package:

$ sencha repo add alfonsonishikawa
$ sencha package install nishilua-server-url-placeholders
Add it to your app.json:
    requires: [
        .... ,
It will be downloaded automatically when doing:
$ sencha app watch
And you can start to use it.


  • ExtJS
  • ExtJS