extjs group by letter - extjs

does anyone knows how to use extjs's groupingview and group by the first letter of the particular field indicated by the groupingStore?
For instance:
group 'l':
record with field 'lion'
record with field 'leopard'
group 'g':
record with field 'giraffe'

ok i got it. Basically I need to edit the grid column's groupRenderer :
groupRenderer:function(v,u,r,rowIndex,colIndex,js){
return r.get('fieldname').charAt(0);
},

Related

Salesforce Validation Rule to compare value of one pick-list with other pick-list

I need to write validation rule on account, which will check valid country name from other pick list filed in exits in same object. In case that country name does not match from other country picklist then error should be displayed at account.
Thanks,
Satya
You can try the below
TEXT( Field1 ) != TEXT( Field2 )
There are several functions available to use. You can find them while creating the validation rules.

How to query for User Display Name using LisData.svc SharePoint Online

As you know when using the listdata.svc people picker fields return the userID, not the display name (createdby, modifiedby). I have been looking for a way to query the userprofile svc but have found nothing helpful.
What i am looking to do, is simply convert this ID to their respected display name. I am new to using this listsvc and this was never and issue using empty data views and XSL. If anyone has an example of grabbing list data, and showing the createdby, modifiedby, or a custom people picker field and showing their name not id that would be very helpful.
Thanks in advance
This is a default behavior, for a user field, only Id property is getting returned in the result. To return all the properties of user field $expand query options needs to be applied to the query, for example:
/_vti_bin/ListData.svc/Documents?$expand=CreatedBy,ModifiedBy
In that case the projected field values for CreatedByand ModifiedBy fields (from User Information List) are returned along with the result.
To return a specific user field properties, the $select query option could be specified. For example, the following query returns DisplayName (Title property) of CreatedBy and ModifiedBy fields:
/_vti_bin/ListData.svc/Documents?$select=CreatedBy/Title,ModifiedBy/Title&$expand=CreatedBy,ModifiedBy

Table with dummy row (ID 0) and auto increment index

Is it legal/okay to create a row with ID '0' and AFTER that set auto increment of that ID column to (1, 1)?
Why do I ask this?
I have a table Products with columns ID and Name. I want to show all Products inside my application in a ComboBox. Users can select a product but the default entry should not be 'Product 1' but something like '(Nothing selected)'. Is it okay to create a 'dummy row' with 'ID = 0' and Name = '(Nothing selected)' in database so the application will automatically display it as default selected item?
I think the better solution is to programmatically add a please select option and validate against it, assuming you don't really want users to have this selected? I guess in theory what you've proposed should be OK though? You'd have to be careful retrieving the values in order of their Id though, if you ordered them by name you'd have to ensure you pulled Id = 0 first then ordered the rest which feels like more work then programmatically adding the option where needed to me.
If your users can have nothing selected then programmatically add the nothing selected option and handle saving no value if it is selected. Otherwise you're saving data that represents no data really which could be deemed a waste of memory.

SSRS 2008:How to hide a table row (Conditionally) based on category field

I am new to Sql Server Reporting Services. I have created my following report.
I want to remove/hide rows of Brand Total whenever it does not exist in Brand list. Like in following picture i want to remove/hide "Ethnic Total" whereas "Ethnic" Brand does not exist in "Sample Store 1".
Similary i want to reomve/hide rows of "Outfitters Total" and "Junior Total" from Section Two whereas "Outfitters" and "Junior" don't exist in "Sample Store 2".
This is the structure of my report.
And following is the expression for Net Qty of a Single Brand total.
=Sum(IIf(Fields!Brand.Value = "Outfitters", Fields!Quantity.Value, Nothing))
What should i do?
What condition should i write in expression for Row Visibility?
Thanks in Advance for help.
i hope the below comments you are looking for.
Step 1: select that particular row (Outfitlers Total, Junior Total,Ethnic Total,Store Total)
One at a time and right click and select Row Visibility Option.
Step 2 :
A Dialog box appears with 3 options
1.Show
2.Hide
3. Show or hide based on expression
Select option 3 and copy the below expression in the Expression dialog box.
=iif((Sum(IIf(Fields!Brand.Value = "Outfitters", Fields!Quantity.Value, Nothing))) is nothing ,True,False)
i hope So this will be helpful.
=IIF(Fields!TotalRems.Value=0, True, False)
Replace TotalRems with your correct field name
You can do this way:
=IIF(Fields!YourField.Value like "YourValue",false,true)
Replace "YourField" with your own one and also change "YourValue" to whatever you need.
NB, " " or '' not treated as NOTHING,
For more explanation:
SSRS – Hide Rows in a Group based on a Value
another possibility for the hiding expression is, to use a text box reference. In place of "Textbox1" in the expression below, you can use the name of the text box, which is in the crossing of column "Net Qty" and row "Ethnic Total" (or one of the other total rows you mentioned)
=Iif(IsNothing(ReportItems!Textbox1.Value),True,False)

EXTJS GridPanel and Column Data defaults

I have a a gridpanel that has the following fields:
Name ID Address Home_Phone Cell
Some records that return to the store may not have any data for some of these fields, rather then display an empty column for that record in the grid I would like to show a default value of N/A.
So I would have
Name ID Address Home_Phone Cell
Shaun 2 My Address N/A N/A
Rather then:
Name ID Address Home_Phone Cell
Shaun 2 My Address
I know of two ways to do this:
In the back end if the field doesn't exists return a "N/A" for that column in the JSON.
Create a template with a method that check if the record doesn't contain the value return "N/A".
My question is, is there an easier way to tell the grid column if no value is found in the record display the default N/A?
You can add a renderer for your columns. You either add a renderer for each column or you can define your own column if you have more columns with this behaviour.
//add this for each column config (works for null values and empty strings)
{
renderer: function(value){
if (Ext.isEmpty(value)) {
return 'N\\A';
}
return value;
}
}
or add the renderer to a component that extends the column and use that throughout the application.
It's easier to do this on the front end rather then modifying the backend and sent extra unnecessary data like 'N\A'.
Hope It helps.

Resources