I am using jqgrid Advanced Search functionality in my project. I want to display the first overall row at all times irrespective of search. Is there a way how I can achieve this?
What do you mean by first overall row?
Are you fetching details from a list or from a database?
You can use a Dataprovider object and use it's setSort method..
If the data is coming from a database this can easily be done by using the sort property to pass it as the sort by property in your sql statement, if you're using a list you can use Collections.sort() but your list object has to have a sorting algo that it should follow..
Related
Is there a way to dynamically append a driving distance of the CONSUMER in ES?
I am trying to create an app and sort PROVIDERS by driving distance.
One thing I could think of is get all the PROVIDERS within a range then put them in an array. Iterate to add driving distance then sort array. But this is not efficient.
Any suggestions?
thank you!
You can use runtime fields to achieve what you want, A runtime field is a field that is evaluated at query time. Runtime fields enable you to:
Add fields to existing documents without reindexing your data Start
working with your data without understanding how it’s structured
Override the value returned from an indexed field at query time
Define fields for a specific use without modifying the underlying
schema
For more information you can check Elasticsearch blog post here, and for runtime fields here.
Right now i'm trying to solve the problem where a calculated field for each object in a set of objects is dependent on input from the client and the results need to be sorted by this calculated field.
I know it is easily solvable using SQL, but let's say the query results are dependent on multiple external API's and calculated fields are dependent on the results of these API requests. How would the client be able to sort these query results using one of the available calculated fields?
So I created a new custom field for Account called Total Potential Revenue of type Currency. But when I click on the field name to sort the data, it shows an "up and down arrow" like sorting but the data is not sorted. I tried changing the data type to Number or Floating point number but still unable to sort the data. Is there any way to fix this? Thanks in advance.
Your RetrieveMultiple plugin needs to handle the sorting. CRM is passing the sort expression to the database which doesn't have any data to sort which is why you're getting what seems like a nonsensical order.
Your plugin should pull the order expressions out of the request (if the query was a QueryExpression, for example, the order expressions are found in the queryExpression.Orders collection) and then sort your results accordingly before returning the collection.
Suppose you have millions items(say search results) and you have different parameters for sorting these items(like in eCommerce sites). We will be showing the items using pagination.
Let us say it can be sorted by date, popularity and relevance and results are paginated. How would you implement this functionality? Generally I would create different compare functions for parameters and get results accordingly.
If there any other efficient way to have this kind of functionality instead of sorting the search results every time? Also, do we generally run sql query every time using relevant order parameter or should we sort the search result of previous query to save us from re-searching time?
"If there any other efficient way to have this kind of functionality instead of sorting the search results every time?"
I would say you do not need sort every time but execute SQL query with appropriate OrderBy parameter, paginate it and show to the user
"Also, do we generally run sql query every time using relevant order parameter or should we sort the search result of previous query to save us from re-searching time?"
For sure you need to generate a new SQL query, as the first page data based on a new order parameter can contain completely different set of data from previouse one.
I have a search page with multiple search options(input text boxes) Based on the search criteria entered , I need to create a dynamic search query. (I need search results based on the fields for which user inputs some value)
or you can use <af:quickQuery> for a simple search. Here's the sample code taken from Oracle demo.
<af:quickQuery label="Search" id="search" searchDesc="search" binding="#{editor.component}" value="#{demoQuickQuery.queryDescriptor}" queryListener="#{demoQuickQuery.processQuery}">
</af:quickQuery>
If you are using ADF/BC, this is built-in. Just use the <af:query/> component.
af:query is the more robust of the two query components, but does require you create a viewcriteria object in the VO that will be the basis for the query. However it is very powerful: dynamically add new attributes to the query at runtime, change query rules (starts with, contains, etc)
af:quickquery allows you to choose one and only one attribute to query on at a time.
Please note: these components (and the executewithparms) are the only supported query methods in ADF Faces 11g