Comments (2)
Isn't it possible to do the concatenate part in PHP code? You now the possibility that you can specifiy an anonymous function as the data key for a column? The database row is passed to it as the first argument. So there you can concatenate and return the value in the function.
from pike.
That was my initial idea as well. However for some reason my custom formatter is not accepted by Jqgrid.
Also, I think it would be more consistent to specify the fields to be concatenated in the select clause instead of writing and applying custom formatters for every occasion. It would also be a pain to have to hide all source fields of the concat after formatting.
EDIT: I had success formatting a field so that it represents a concatenation of 2 other fields. However, there are 3 shortcomings in this approach:
- The formatter needs the exact positions of the fields (row object is a regular array) to be concatenated
- The fields need to be hidden manually
- Filtering only works for the data that is in the field by default. In my example I used zip code and city. I have hidden the zip code field and added a custom formatter to the city. The formatter then uses the index of city and concatenates it with the prepended zip code (City-Index -1 in the row array). The problem here is that filtering only works for city, not for zip code.
from pike.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pike.