Jqgrid Details Note-jqgrid in custom format, URL format

Source: Internet
Author: User
Tags jqgrid

This article from: http://cnn237111.blog.51cto.com/2359144/782137

Jqgrid in custom format, URL format when the official comes with the showlink is not very handy, so you can consider yourself to define the URL format custom format is very simple, in formatter: Fill in the function name such as Formatter:makeurl. , you can create a makeurl function. The signature of the function must follow the official convention, with 3 parameters. functionMakeurl (Cellvalue, Options, Rowobject) {returnurlstring;} Cellvalue-is the value to be formatted options-An object that contains the options: {Rowid:rid, colmodel:cm} rowId is the Rowid,colmodel of the current row is the value defined in Jqgrid rowobject-is the value of the current row. An example of each value assignment is as follows: if: Colmodel: [{name:"FileName", index: "filename", 550, SortType: "string", sortable:true, formatter:makeurl},{name:"DateTime", Index: "datetime", SortType: "string", Formatter: "string", sortable:true }],functionMakeurl (Cellvalue, Options, Rowobject) {alert (cellvalue); alert (rowobject["Test"]);//The value here is the corresponding value in the returned JSON. Alert (options["RowId"]); Alert (options["Colmodel" ["name"]);//The "filename" is returned herewith this trick, it's easy to return some custom URLs, and whatever parameters can be easily obtained, just from rowobject["Test"the data can be taken from objects such as. There is also a more straightforward way to direct the fields to be displayed directly in the returned JSON with the processed<A> this format processing. In that case, the link directly to the table is the one that can be used directly.

Jqgrid Details Note-jqgrid in custom format, URL format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.