8 Sept 2014

Distinct, Refilter or Remove duplicate value in ComboBox Extjs

The issue is we cannot distinct value from SQL server, or Server code because this function is used in other services.
To solve it we use filterBy function of Store.

me.store = new Ext.data.DirectStore({
                directFn: Combo.Remote.LoadPrincipalByQuotation,
                autoLoad: true,
                root: 'data',
                fields: ['PrincipalId', 'PrincipalName', 'QuotationId'],
                filters: [{
                    property: 'QuotationId', value: me.quotationId
                }],
                listeners: {
                    load: function (obj, records, successful, operation, eOpts) {
                        var hits = {};
                        obj.filterBy(function (record) {
                            var name = record.get('PrincipalId');
                            if (hits[name]) {
                                return false;
                            } else {
                                hits[name] = true;
                                return true;
                            }
                        });

                        // delete the filtered out records
                        delete obj.snapshot;

                        if (records != null && records.length > 0 && me.selectFirst)
                            me.setValue(records[0].data.PrincipalId, true);  
                    }
                }
            });

Enjoy IT!

13 May 2014

Security for list item - How many way to deal with permission on item level?

Scenario: There is a library contain documents, which same type. But we have three departments using this library. We must do how each departments not see documents from other. For example: we have documents for Hr, Marketing, Administration. The document is categorized by a Field.
=> What is the best solution for this scenario when using SharePoint?

Here is the Solution  - https://www.nothingbutsharepoint.com/sites/eusp/Pages/SharePoint-Easy-Row-Level-Security.aspx


1 Dec 2012

How to writing an quality article?


  1. start with a topic you want to write. any topic about your life or anything else attract you.
  2. Don't care too about English grammar. ;)
  3. when start trying to write every day. and get that to be your habit.
  4. The first articles must not too long. 
Bad English :) 1st

16 Aug 2012

Myers-Briggs preferences list

Myers-Briggs preferences list
Preference Characteristics
Introversion Turns inward for inspiration. Focuses on concepts and ideas and tends to be reflective. Works best alone. May forget to consider the external world or to get feedback from others.
Extraversion Gets inspiration from other people, likes to multi-task, and tends to make decisions on the spot. May forget to plan ahead.
Judging Likes work organized and under control. Tends to be task-orientated, and enjoys having a structure and a plan. Likes to finish work before relaxing. May be rigid or compulsive and may ignore new information if it is not in line with existing plans.
Perceiving Likes to stay open to change, relaxed and casual. Works best in brief bursts of energy, mixing work and play, and being spontaneous. May not keep time well.
Sensing Relies on direct experience to gather information. Concerned with facts and concrete goals. Tends to be practical-minded, have memory for detail, and plan well. Doesn't trust hunches that seem to come out of nowhere, but instead looks for facts and details. May focus too much on present tasks and therefore fail to plan thoroughly into the future. May also forget to take other people into account when making plans because of being so task-focused.
Intuition Sees broad patterns, meanings, and relationships, rather than specific details. Abstract and creative thinker. May be impractical. May struggle to come up with very specific and fixed plans, or may fail to notice important details.
Thinking Focuses on being objective, technical, and consistent when making decisions. Values truth and fairness. May not notice people's feelings or be too focused on goals.
Feeling Makes decisions based on personal concerns. May appear compassionate and caring. Values tact and communication. May be idealistic. Values harmony above truthfulness. Finds protocols stifling or frustrating. May be easily distracted.

Energy and Task Management

Purpose: Use this job aid to determine how to schedule tasks according to your energy level.

The energy cycle
Time Tasks
Morning Your energy levels are at their highest, and you are alert, so you'll be able to "think on your feet" and handle difficult or complex issues.

The morning is best used for decision making and intellectually challenging tasks. You should try to schedule meetings or conference calls at this time of the day.

You should also focus on reading and analyzing information, problem solving, and resolving difficult issues.
Early afternoon Your energy levels begin to dip in the afternoon. During this time, you should avoid mentally challenging tasks and work that requires active short-term memory and quick thinking.

At this time of day, your pain threshold is generally at its highest. This is an ideal time to visit the dentist or chiropractor, or to schedule other appointments that might involve discomfort.
Late afternoon Your energy levels are at their lowest during the late afternoon. You should not attempt to do anything mentally taxing, such as problem solving, or calculations. You should avoid scheduling meetings at this time as well. Instead, concentrate on reflective and creative tasks.

This may include thinking about issues, writing, processing information, preparing for speeches or presentations, or anything that involves using your long-term memory.
Evening As evening begins, you will find that your energy levels begin to increase. But although your energy levels are recovering, you aren't as alert as you were at the beginning of the day.

This is the time to undertake routine or repetitive work that requires concentration, but not analytical skills. Focus on tasks such as filing, making follow-up calls, checking documentation, or data input. This is also the best time to do physical exercise.

Time Logging

Purpose: Use this follow-on activity to guide you in creating a time log and weekly summary.

When creating a time log, you need to record every activity for a week. Write down each activity as it ends, providing as much detail as possible. Each activity should be given a category and a priority. The priority should be based on whether the activity is directly linked to your critical goals.

You can use the following categories and information checklists:

  • planning and organizing, which includes time spent setting or reviewing goals, creating schedules and to-do lists, and organizing files and information
  • meetings, which includes time spent on formal meetings, as well as their purpose and what they accomplished
  • thinking and problem solving, which includes time spent considering issues, strategies, and problems
  • phone calls, which includes time spent on calls, who these calls were with, and what was discussed
  • e-mail, which includes time spent reading, writing, and responding to e-mail and what the subject of those e-mails was
  • reading or writing, which includes time spent reading or writing reports, articles, and evaluations, and what the purpose was for this
  • interruptions, which includes time spent on interruptions and why you were interrupted
  • casual meetings, which includes time spent meeting one or two colleagues in unscheduled meetings and what these meetings were about
  • socializing, which includes time spent talking to others about non-work-related topics
  • breaks, which includes time spent on breaks and what you did in these breaks
  • personal time, which includes time spent on personal calls, e-mail, doctors appointments, and
  • lunch, which includes time spent on lunch, where you had lunch, and what else you did during your lunch break

Remember that these categories are simply a guide. You can create other categories better suited to your work as needed.

Once you've logged your time for a week, create a table with all the categories you used to define your time. Then add the total time spent on each category. Next you divide the total by 5 (if you work a 40-hour week over 5 days) to get the average amount of time spent on each category per day. Finally, assess the priorities given to each category to determine how much time you're spending on high-priority tasks.

Time log table
Time Minutes Category Description Priority

For online use, complete each row as described in the instructions. If you would like to work with the page as hard copy, simply print it out using the Print link at the top of this page.

You can use the next table to create your own time log summary table.

Time log summary table
Category Total time Average time Priority

10 Aug 2012

Challenging Negative Thinking - Assertively Defining Your Boundaries

Challenging Negative Thoughts
Technique Description
Examining the evidence Negative thinking usually involves exaggeration of the negative, or imagining the worst. You need to look for the actual evidence of what happened rather than simply assuming that your version of the events is the correct one.
Befriending yourself Negative thinking turns you into your own worst enemy. Instead of beating yourself up, think about how you would react to a friend in a similar situation. What would you say? Would you be as harsh and judgmental as you're being to yourself?
Putting things in context You should try to put your thoughts in the context of your life as a whole. This will help you to dismiss some of your most outrageous negative thinking, and possibly see the extent to which you're exaggerating the problems you face.
Looking for the positive Try to see the positive in any situation. From the starting point of "the presentation was a complete disaster," you should be able to draw positive aspects from what has happened--usually something will have gone well.
Assertively Defining Your Boundaries
Step Description
Get attention Getting attention means finding a time when it is appropriate to talk, and then calmly explaining your perspective.

  • You should always deal with issues quickly, but it is also important that you choose a time when you aren't feeling angry or irritated. This may involve a "cooling off" period. You should also make sure that you can discuss the issue without distractions.
  • You need to explain why you are unhappy or unwilling to comply with a request. Avoid language that is critical or accusatory, and stick to the facts of the situation. It is also helpful to offer a concession to the other person to show that you are being reasonable.
Command a positive response When you've got the attention of the person you're trying to negotiate with, you need to get the response you want – a positive one.

  • When you've made the other person aware of the facts of your situation, you need to get them to buy-in to helping you. You can do this by inviting them to change the situation or by getting them to see the problem from your perspective. Remain calm and reasonable even if the response is negative.
  • Show that you would appreciate a serious offer, possibly to withdraw the request or to compromise. If no offer is forthcoming, or if you disagree with the other person's proposal, make a proposal yourself. Being assertive means being forceful and not caving in to pressure at this point.