Support » Plugin: WPF-jqGrid » Extra parameters passed in shortcode

  • Hello,

    I didn’t find the possibility to limit the list of table’s fields in the shortcode phrase. Please, advise if it’s available.

    Also it’s worth to have my own ‘Where’ clause for SQL to be passed through shortcode. What is the best way to do that? In what source files and functions these parameters should be added (let’s call them ‘sqfields’ and ‘sqwhere’)?

    Regards

    https://wordpress.org/plugins/wp-fjqgrid/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author faina09

    (@faina09)

    the plugin is intended to manage custom created tables, i.e. to have all the filelds and all the data, and filter the last by end user. It is not easy to modify the field list nor the where clause, anyway it can be done inserting shortcode options and code in the private function fjqg_javascript( $options )

    Thank you.
    What should I also do to make ‘sqfields’ parameter become visible/accessable in the class ‘FjqGridShortCodes’ (and I sssume also in FjqGridDB to access in public function get_rows())?

    Plugin Author faina09

    (@faina09)

    there is not a ‘sqfields’ parameter. The fields are grabbed from db and a jscript is generated with this field list. You can have a look at html page generated to understand how the plugin works. Probably a simple solution is to access a VIEW on mysql having the fields you want

    Yes, sure.

    As I mentioned in the 1st post the goal is to add some extra paramaters with the names like ‘sqfields’ (the list of fields instead of all fields with ‘*’) and ‘sqwhere’ with WHERE clause of SQL.

    I.e. I want to have something like:

    $select_sql = “SELECT $sqfields FROM {$this->tablename} WHERE $sqwhere”;

    instead of

    $select_sql = “SELECT * FROM {$this->tablename}“;

    in function get_rows() of FjqGridDB class in wpf-jqgrid-db.php

    P.S. I also see the phrase $select_sql = “SELECT ” . implode( ‘,’, $fields ) . ” FROM {$this->tablename}” in this function get_rows() but I can’t understand how to pass the list of fields to it, i.e. to add data to $fields variable. Please, advise.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra parameters passed in shortcode’ is closed to new replies.