Question: First of all i am very glad to use dataTables - it is easy to use and nice solution if you have to work with tables in HTML pages. 
When my table was about 700 rows and 10 cols everything was great! 

But now my table is about 3000 records (rows) and maybe about 10 rows and performance of search dramatically decreased. I updated version of datatables.js script from 1.9.4 to 1.10.7 - but i see no changes in speed while i am searching for something in my table. I tried it with pagination enabled or disabled - no difference. 

What can be done to increase performance and speed of search? I am abolutely sure that 3000 records is not big deal for great library like dataTables!

**UPDATE** i use it with static page and TableTools add-on. My options are

```
"sDom": 'T<"clear">lfrtip',
"oTableTools": {***tableTools options**},
"sPaginationType": "full_numbers",
"bPaginate": true,
"iDisplayLength": 30,
"bLengthChange": false,
"bInfo": true,
"oLanguage": { *** some translations *** }

```

Answer: 
If your goal is to have the dialog tell the activity which button was clicked, then you can use an interface as a callback from the dialog to the activity.

To do this you should first define the interface in your dialog fragment. 

In your activity when you show a dialog fragment there is an acivity lifecycle method called onAttachFragment() that gets called. When this gets called you check to see that the fragment being added is your dialog fragment. If it is, this is where you set the listener.

Now when your button is clicked in your dialog fragment you can make a callback to the activity using the listener.

In your dialog fragment code:

```
public class DifDialog extends DialogFragment {

private DifDialogListener mListener;

public interface DifDialogListener {
    void onButtonOneClicked();
    void onButtonTwoClicked();
    void onButtonThreeClicked();
}

public void setListener(DifDialogListener listener) {
    if (listener == null) {
       throw new NullPointerException();
    }
    mListener = listener;
}

    public Dialog onCreateDialog(Bundle savedInstanceState) {

    AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
    builder.setTitle(R.string.difficulty);
    builder.setItems(R.array.diff, new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
       if (which == DialogInterface.BUTTON_POSITIVE) {
           mListener.onButtonOneClicked();
       } else if (which == DialogInterface.BUTTON_NEGATIVE) {
           mListener.onButtonTwoClicked();
       } else if (which == DialogInterface.BUTTON_NEUTRAL) {
           mListener.onButtonThreeClicked();
       }
});

Dialog dialog=builder.create();

```

return dialog; }}

In your activity:

```
showDialog() {
    DifDialog dia = new DifDialog();
    dia.show(getFragmentManager(), "test");
}

@Override
onAttach(Fragment fragment) {
    if (fragment instanceOf DifDialog) {
        DifDialog frag = (DifDialog) fragment;
        frag.setListener(new DifDialogListener() {
            @Override
            onButtonOneClicked() {
                //Button one was clicked
            }

            @Override
            onButtonTwoClicked() {
                 //Button two was clicked
            }

            @Override
            onButtonThreeClicked() {
                 //Button three was clicked
            }
        });

    }
}

```
Hope this helps 

```
    List<String> optionsList = new ArrayList<String>();

    optionsList.add("Option One");
    optionsList.add("Option Two");
    optionsList.add("Option Three");

    final CharSequence[] options = optionsList.toArray(new CharSequence[optionsList.size()]);

    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle("Title");

    builder.setItems(options, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int item) {
            if (options[item].equals("Option One")) {
               //do something
            } else if (options[item].equals("Option Two")) {
               //do something
            } else if (options[item].equals("Option Three")) {
               //do something
            } 
        }
    });
    builder.show();
}

```